On 16/04/10 19:16, Maginot Junior wrote:
> Hi.
>
>
>
> I'm wondering if anybody knows how to make my lfs system automatically
> get ip when we plug the ethernet cable. If the system boots with the
> cable connected then I get ip with dhcp, but after boot if I plug the
> cable I have to manually run into the terminal to configure the
> network. I notice that distros like Ubuntu detects when the cable is
> plugged and automatically connects, how can I implement that on my
> distro, is that anything to do with avahi?
>

Do you need to use a dynamic IP address assigned by dhcp? I use static addresses
and if I set up the addresses and then plug in the ethernet cable it works as 
you
describe. The router has a dhcp daemon running on it which I could use but I 
find
it more effective to set up the network with static addresses. That way all the
computers on the network have an entry in /etc/hosts which makes it easy to use
services like ssh.

I use this bootscript on this computer

#!/bin/bash
ip addr add 192.168.1.5 dev eth0
ip link set eth0 up
ip route add 192.168.1.1 dev eth0
ip route add default via 192.168.1.1 dev eth0

192.168.1.1 is the router. 192.168.1.5 is this computer. My netbook is 
192.168.1.4
and its bootscript looks like this

#!/bin/bash
ip addr add 192.168.1.4 dev wlan0
ip link set wlan0 up
wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 -Dwext
ip route add 192.168.1.1 dev wlan0
ip route add default via 192.168.1.1 dev wlan0

Andy
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to