These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/Bringing Up Networking Manually

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:

 # ifconfig eth0 192.168.0.2 netmask 255.255.255.0
 # route add 192.168.0.2 eth0

Finally, we need to place our name servers into /etc/resolv.conf

 # /etc/resolv.conf
 nameserver 128.196.188.95
 nameserver 128.196.188.2


Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited October 15, 2003 4:20 pm (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.