LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2006, 09:11 AM   #1
pazkaw
Member
 
Registered: Aug 2004
Location: Netherlands
Distribution: Slackware 10.2, Debian Etch
Posts: 43

Rep: Reputation: 15
Configuring 2 NICs on Slackware with DHCP


Hi all,

I just managed to install my new 2.6.13 kernel on my Slackware box, but, just like before, my internet still fails to work. I have 2 NICs in my PC:

On eth0 a NIC which works fine, if I plug that one in, run netconfig and put in the desired information.

On eth1 a Marvell Yukon NIC (1GB, supported by the Kernel). If I switch to that one, run netconfig, it fails to boot.

I downloaded a dhcp package and configured the client, I think, using some tuto's I googled for.
So, when the dhcp package starts up during boot, it tells me it receives the IP address 192.168.1.1...lol. Ofcourse, it doesn't work.

These are some files that you might need to help me out:

/etc/rc.d/inet1
/etc/rc.d/inet1.conf
/etc/hosts
/etc/dhclient.conf
/etc/rc.d/inetd.conf

Dunno which one would be helpful, just posted a bunch... I don't know a lot about those internet thingies, just know it doesn't work!

Please help,
Pazkaw

Last edited by pazkaw; 01-02-2006 at 09:12 AM.
 
Old 01-02-2006, 10:41 AM   #2
ralvez
Member
 
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298

Rep: Reputation: 30
To add a second Nic card to a system, running Slackware, folow these steps:

1. Add the card and boot the system.
2. go to /etc/rc.d/rc.inet1.conf and edit the file. Look for:

# Config information for eth0:
IPADDR[0]="192.168.1.21"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="192.168.1.22"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

Last edited by ralvez; 01-02-2006 at 10:43 AM.
 
Old 01-02-2006, 12:32 PM   #3
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
pazkaw:
If you have eth0 & eth1, both on the same ip subnet, then slack will try to use eth0 by default. This is proven by looking at your routing tables.
Please post output of
Code:
route -n
So, they may in fact both be working, however, when you move the ethernet cable from eth0 to eth1, and ping the router/internet, it's trying to transmit those packets out your eth0 interface, because that's what the routing table is telling it to do.
 
Old 01-02-2006, 03:40 PM   #4
pazkaw
Member
 
Registered: Aug 2004
Location: Netherlands
Distribution: Slackware 10.2, Debian Etch
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ralvez
To add a second Nic card to a system, running Slackware, folow these steps:

1. Add the card and boot the system.
2. go to /etc/rc.d/rc.inet1.conf and edit the file.
...
Added the card (it already was, but did it again to make sure...can't hurt) and edited the rc.inet1.conf file as described. No luck...

Quote:
Originally Posted by WindowBreaker
pazkaw:
If you have eth0 & eth1, both on the same ip subnet, then slack will try to use eth0 by default. This is proven by looking at your routing tables.
Please post output of
Code:

Code:
route -n
So, they may in fact both be working, however, when you move the ethernet cable from eth0 to eth1, and ping the router/internet, it's trying to transmit those packets out your eth0 interface, because that's what the routing table is telling it to do.
Hmmm could be the problem, and seems a very reasonable explanation... this is the output of the route -n command you asked for:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
Don't know whether this output is good or bad... Uhmm... please help!

Cheers,
Pazkaw
 
Old 01-02-2006, 04:26 PM   #5
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Notice how "eth0" is listed under the Iface column of the "route -n" output? If there was also an entry for eth1 as there should be, I believe (not sure) it would try to use both when pinging. That means as it is, linux will only send packets destined for that destination (192.168.1.0 network) out thru the eth0 interface.
Do the following:
Code:
ifconfig eth1 <ip.add.re.ss>
Now, if
Code:
route -n
still doesn't show an ethry, with eth1 as the Iface, then do:
Code:
route add -net 192.168.1.0 dev eth1
to add the route manually.
Confirm the route was added with:
Code:
route -n
Then move ethernet cable to eth1, and
ping <router.ip.add.ress>

If still not working, then post output of "route -n" after adding the above route.
 
Old 01-03-2006, 10:37 AM   #6
pazkaw
Member
 
Registered: Aug 2004
Location: Netherlands
Distribution: Slackware 10.2, Debian Etch
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks alot for your reply, WindowBreaker!
My route -n shows now my eth1 port:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
When I try to ping to my 192.168.1.0 address, it works fine as well:
Code:
PING 192.168.1.0 (192.168.1.0) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=0.026 ms
64 bytes from 192.168.1.10: icmp_seq=4 ttl=64 time=0.019 ms

--- 192.168.1.0 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.019/0.024/0.027/0.004 ms
And trying to ping to my external IP works fine either...:
Code:
PING 217.220.162.xx (217.220.162.xx) 56(84) bytes of data.
64 bytes from 217.220.162.xx: icmp_seq=1 ttl=255 time=0.476 ms
64 bytes from 217.220.162.xx: icmp_seq=2 ttl=255 time=0.636 ms
64 bytes from 217.220.162.xx: icmp_seq=3 ttl=255 time=0.560 ms
64 bytes from 217.220.162.xx: icmp_seq=4 ttl=255 time=0.473 ms

--- 217.220.162.xx ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.473/0.536/0.636/0.069 ms
But when I ping to any IP on the net, it doesn't receive anything:

Code:
PING 64.233.183.99 (64.233.183.99) 56(84) bytes of data.

--- 64.233.183.99 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3013ms
Also, when I open a browser and enter any URL, e.g. LQ.org, no results come up either and I receive a "host not found" error...

Very strange!

Last edited by pazkaw; 01-03-2006 at 10:41 AM.
 
Old 01-03-2006, 11:32 AM   #7
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Your default route, which looks like
Code:
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
will try to use eth0 for all external access. It will forward all packets destined for the Internet, to your router/gateway (192.168.1.1), thru interface eth0. If you unplugged eth0 and want to use eth1 instead, you need to update your default route, and change the interface to eth1.
Optional:
Code:
route del default gw 192.168.1.1
Mandatory:
Code:
route add default gw 192.168.1.1 dev eth1
After adding the routes, confirm them with
Code:
route -n
Then try to ping the outside ip address again.
 
Old 01-03-2006, 12:29 PM   #8
pazkaw
Member
 
Registered: Aug 2004
Location: Netherlands
Distribution: Slackware 10.2, Debian Etch
Posts: 43

Original Poster
Rep: Reputation: 15
Ok, route -n now outputs the following:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
...which should be right, shouldn't it?

When I now ping to my own IP I receive the following:

Code:
PING 217.220.162.xx (217.220.162.xx) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=2 Destination Host Unreachable
From 192.168.1.1 icmp_seq=3 Destination Host Unreachable
From 192.168.1.1 icmp_seq=4 Destination Host Unreachable

--- 217.220.162.xx ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3000ms
, pipe 3
...Same results when I'm trying to ping to any other external IP address, like 64.233.183.99...

Last edited by pazkaw; 01-04-2006 at 01:22 PM.
 
Old 01-04-2006, 01:23 PM   #9
pazkaw
Member
 
Registered: Aug 2004
Location: Netherlands
Distribution: Slackware 10.2, Debian Etch
Posts: 43

Original Poster
Rep: Reputation: 15
Update:
Sth. else: Every time I shutdown my machine, it complains "SIOCADDRT: File already exists"...think it's a message from my DHCP server package I installed, but I'm not sure.

Also, every time I reboot my machine, the previous made configurations to route -n disappear, and I have to do the process as described by WindowBreaker ^^^ all over again.

When I try to add 192.168.1.0 instead of 192.168.1.1 as default gateway, it complains: "SIOCADDRT: Network is unreachable"...

Can anybody help?
Pazkaw
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring SUSE 10 with 2 NICs as gateway/DHCP Samhein Linux - Networking 3 11-24-2005 11:05 AM
DHCP server with two NICs Infernal211283 Linux - Networking 2 02-14-2005 03:51 PM
dhcp and 2 nics mikz Linux - Networking 3 01-27-2005 03:38 PM
Configuring 3 NICs TuxFreak Linux - Networking 4 01-12-2005 03:16 PM
Slackware 8.1 - Two NICs and DHCP Gn0me Linux - Networking 5 05-15-2003 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration