did I do this right? (linux networking)

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
its on an old machine, so no plug'n'pray.
after about an hour of trial & error (plus watching a movie ;)) I created a script that does the following things that you have to run on boot:

1. modprobe eexpress io=0x200 (found the io by trial and error)
2. ifconfig <ip> netmask <subnet> eth0
3. route add <gateway ip>
4. route add default gw <gateway ip>

leaving out step 3 results in the computer not being able to reach anything past the gateway. I assume that step 3 tells it the static route to the gateway or something?
 

manly

Lifer
Jan 25, 2000
13,317
4,092
136
That looks about right to me. Most distros script all this stuff for you; you just have to use some configuration tool to choose your networking device, and basic IP configuration (i.e. static addressing or DHCP client).

As far as the default gateway, there has to be an existing route to get to the default gateway IP before you can insert the default route.

So for example, step 3 can either be a route to a network or a host. You probably already have, but read the TCP/IP HOWTO to brush up on these topics.. it's a great intro (just skip all the archaic hardware sections).
 

thornc

Golden Member
Nov 29, 2000
1,011
0
0
what distro??
Redhat/Mandrake has the configuration file /etc/sysconfig/network to handle this, slackware uses
one rc script.
Don't know how debian, suse do it but it shouldn't be very different!
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81


<< (just skip all the archaic hardware sections) >>


i'm using lots of archaic hardware :D

anyway, its redhat 5.2, but I must be incompetent cause I can't figure out how to get it to do this itself. I mean, i could move this to /etc/rc.d/rc3.d or something, but that isn't really the right way. anyway, the existing networkscripts just say usage: "ifup <device>" if I use eth0 (same for the others like ifup-routes), but work if I use lo, so something isn't recognizing eth0's existence properly :(o
 

manly

Lifer
Jan 25, 2000
13,317
4,092
136
I'm probably wrong since I haven't used Red Hat 5.2 (or any version for that matter) in ages, but the command line tool to configure your network settings is surprisingly enough called

netcfg
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
check out my reply in this thread here

you need to emulate the two commands in the "Token Ring" section (but obviously it would be an ethernet card for you)

try and see if you can find the "ifup" command you mentioned somewhere and take a look at it. Its probably a small shell script that just does what my inet1 does.

bart
 

thornc

Golden Member
Nov 29, 2000
1,011
0
0
Add a line to /etc/conf.modules with this:
alias eexpress eth0
options eexpress io=0x200


Then check the /etc/sysconfig/network file.
This is the file that if-up uses to read the configuration...