LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 network interfaces trouble (https://www.linuxquestions.org/questions/linux-networking-3/2-network-interfaces-trouble-481065/)

Padawan.AVT 09-06-2006 06:10 PM

2 network interfaces trouble
 
The problem is: I have 2 network interfaces (eth0 and eth1 respectively)

eth0 configured and works properly

eth1 configured, but I cannot ping any other PC or ping eth1 from any PC
eth0 was configured earlier using "netconfig"

eth1 was configured in such a way:
ifconfig eth1 172.16.1.110 netmask 255.255.254.0 broadcast 172.16.1.255

Here are the actual settings of both interfaces:

ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0E:2E:22:A7:82
inet addr:172.16.1.111 Bcast:172.16.1.255 Mask:255.255.254.0
inet6 addr: fe80::20e:2eff:fe22:a782/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:76752 errors:0 dropped:0 overruns:0 frame:0
TX packets:131024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6022266 (5.7 Mb) TX bytes:181674480 (173.2 Mb)
Interrupt:11 Base address:0x6000


ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:C0:26:A2:7F:03
inet addr:172.16.1.110 Bcast:172.16.1.255 Mask:255.255.254.0
inet6 addr: fe80::2c0:26ff:fea2:7f03/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:892 (892.0 b) TX bytes:1368 (1.3 Kb)
Interrupt:10 Base address:0x8000

I'm using Slackware. Kernel 2.6.15

bulliver 09-06-2006 06:41 PM

What is eth1 plugged into? Did you set up routing properly? A physical description of your network would help here...

GrueMaster 09-06-2006 06:43 PM

If both interfaces are on the same switch and the same subnet, most network traffic will go to the first interface, then bleed over to the second one. I once set up a server for multiple web sites on our intranet with 4 interfaces (4 separate stactic IP addresses), and the same thing happened. Each web page was served by a particular ip address, and everything worked correctly, except the load was being handled by only one interface. Even configuring our Cisco switches to route separately to each interface, the traffic ended up on one interface.

rahulk 09-07-2006 12:15 AM

Quote:

Originally Posted by Padawan
The problem is: I have 2 network interfaces (eth0 and eth1 respectively)

eth0 configured and works properly

eth1 configured, but I cannot ping any other PC or ping eth1 from any PC
eth0 was configured earlier using "netconfig"

eth1 was configured in such a way:
ifconfig eth1 172.16.1.110 netmask 255.255.254.0 broadcast 172.16.1.255

Here are the actual settings of both interfaces:

ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0E:2E:22:A7:82
inet addr:172.16.1.111 Bcast:172.16.1.255 Mask:255.255.254.0
inet6 addr: fe80::20e:2eff:fe22:a782/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:76752 errors:0 dropped:0 overruns:0 frame:0
TX packets:131024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6022266 (5.7 Mb) TX bytes:181674480 (173.2 Mb)
Interrupt:11 Base address:0x6000


ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:C0:26:A2:7F:03
inet addr:172.16.1.110 Bcast:172.16.1.255 Mask:255.255.254.0
inet6 addr: fe80::2c0:26ff:fea2:7f03/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:892 (892.0 b) TX bytes:1368 (1.3 Kb)
Interrupt:10 Base address:0x8000

I'm using Slackware. Kernel 2.6.15

please dont mind, but i simply dont understand why you want to have two NIC cards for a same subnet?? it will be better if you use a single NIC card (eth 0) and setup a virtual interface on it.
like:-

ifconfig eth0:1 172.16.1.110 netmask 255.255.254.0 broadcast 172.16.1.255


this way you will be able to use two IP addresses on a single NIC card without having to worry about the network load ending up on a single interface. It is always preferred to have virtual interfacing on a single subnet v/s two NICs on a single subnet.

you can add up the new IP address with hostname in /etc/hosts file to make it pingable. Once the entry is taken up by your DNS server, this problem should be solved.

Hope it helps,
Rahul.

Padawan.AVT 09-08-2006 02:43 AM

Thanl you all, the problem is solved. I just configured them for different subnetworks and it worked. I'm trying to set up a gateway for the first time, so I've got a lot of stupid questions


All times are GMT -5. The time now is 12:02 PM.