[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

DHCP - solved!



Many thanks to everyone who helped me getting this to work - amongst others,
Seth, Mark, Phil, Jens, and I'm sure I'm forgetting a bunch.

Turns out that if I tried configuring the LAN NIC first, for some
strange reason dhclient would fail and would take the LAN down with it.
In addition to that, if the NIC had no IP assigned to it, dhclient
would fail with "Unable to create file: eth0" (I think).

Here's my (new and improved) /etc/init.d/network (works like a charm!):

ifconfig eth1 up
ifconfig eth1 192.168.0.254
dhclient eth1
ifconfig eth0 up
ifconfig lo 127.0.0.1
route add -net 127.0.0.0
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=
ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
route add -net ${NETWORK}
[ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1

---
                This is what we do. This is who we are.
-><--><--><--><--><--><--><--><--><--><--><--><--><--><--><--><--><--><-
            Hail Eris! -><- Kallisti -><- All Hail Discordia!


Reply to: