Classnotes | UNIX02 | RecentChanges | Preferences No diff available--this is the first major revision.
(no other diffs)So all of this information we've seen thus far is all well and good, but how do we bring up networking manually?
Why would I want to do something like this?
Well, you would want to do manual networking initialization in those instances that automatic networking doesn't work... duh.
Perhaps the better question to ask would be when would I want to do something like this? Let's take a look at an example.
You have a Unix machine which, for whatever reason, is configured to only connect via DHCP. There are no graphical or simple command-line tools for reconfiguring it for static IP. For some reason, your DHCP server is spitting out incorrect addresses (or simply not responding) and you need to get this Unix machine online for some reason (perhaps it contains information for fixing the DHCP server ;-)
This exact problem has happenned in this class on previous occassions. We had been running from a read-only filesystem (Knoppix) which, at the time, did not include easy to use networking reconfiguration tools.
So how do we go about this manual network configuration? Well, we use the tools we've just discussed!
Setting up the devices
Firstly, make sure that your network device driver module has been loaded. You can usually do an 'lsmod' to verify that it has. If it has not, you will want to load the module:
# insmod your_driver
Next, make sure that the loopback interface is active. Chances are as long as some networking was at least attempted, your loopback will alread be enabled. You can check with ifconfig to be sure. If it isn't, then enable lookback thusly:
# ifconfig lo 127.0.0.1
# route add 127.0.0.0 lo
Next, we need to setup our NIC with our associated address: