LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-18-2005, 10:54 AM   #1
barghota
Member
 
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94

Rep: Reputation: 38
2 NICs problem


Hi, I have 2 NICs with these configuration...

Code:
# more /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.3
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.255.255
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=yes

# more /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.3
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.255.255
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=yes
I have enabled port forward, configured the default gateway as 192.168.1.1 and configured iptables as follow:

Code:
# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
My problem is when i ping from eth0 anything (example google.com) it pings but if i ping from eth1 anything (example google.com), the reply is destination host unreachable

Code:
# ping www.google.com -I eth0
PING www.l.google.com (66.249.85.99) from 192.168.1.3 eth0: 56(84) bytes of data.
64 bytes from 66.249.85.99: icmp_seq=1 ttl=248 time=111 ms
64 bytes from 66.249.85.99: icmp_seq=2 ttl=248 time=112 ms
Code:
# ping www.google.com -I eth1
PING www.l.google.com (66.249.85.104) from 192.168.0.3 eth1: 56(84) bytes of data.
From 192.168.0.3 icmp_seq=1 Destination Host Unreachable
From 192.168.0.3 icmp_seq=2 Destination Host Unreachable
From 192.168.0.3 icmp_seq=3 Destination Host Unreachable
I wish i could ping google from eth1. Thnx at least for reading this
 
Old 07-18-2005, 11:16 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Sorry for asking, but why do you set eth1 on a different network ?
Maybe could you post a schema of your network ?
 
Old 07-18-2005, 05:15 PM   #3
barghota
Member
 
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94

Original Poster
Rep: Reputation: 38
Ok, here is the situation, A router with IP 192.168.1.1, connected to my PC on eth0 which have static IP 192.168.1.3, and I have another PC having IP 192.168.0.4 which is connected to eth1 which have static IP 192.168.0.3.

When i ping www.google.com from the other PC it resolves the ip but returns host unreachable, also when i ping www.google.com from my PC using eth1 it resolves the IP but returns host unreachable. here is the routing table

Code:
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     10     0        0 eth0
192.168.0.0     *               255.255.255.0   U     10     0        0 eth1
default         192.168.1.1     0.0.0.0         UG    10     0        0 eth0
Also here is the output of # ifconfig

Code:
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0E:A6:34:18:04
          inet addr:192.168.1.3  Bcast:192.168.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:a6ff:fe34:1804/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:611721 errors:0 dropped:0 overruns:0 frame:0
          TX packets:678408 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:400852089 (382.2 Mb)  TX bytes:187785752 (179.0 Mb)
          Interrupt:23 Base address:0xe800

eth1      Link encap:Ethernet  HWaddr 00:0C:41:22:44:29
          inet addr:192.168.0.3  Bcast:192.168.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:41ff:fe22:4429/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1012 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:90504 (88.3 Kb)  TX bytes:255919 (249.9 Kb)
          Interrupt:19 Base address:0xd800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5205 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:352429 (344.1 Kb)  TX bytes:352429 (344.1 Kb)

sit0      Link encap:IPv6-in-IPv4
          inet6 addr: ::127.0.0.1/96 Scope:Unknown
          inet6 addr: ::192.168.1.3/96 Scope:Compat
          inet6 addr: ::192.168.0.3/96 Scope:Compat
          UP RUNNING NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
And when i ping 192.168.1.3 from 192.168.0.3 i get also des host unreachable

Code:
# ping 192.168.1.3 -I eth1
PING 192.168.1.3 (192.168.1.3) from 192.168.0.3 eth1: 56(84) bytes of data.
From 192.168.0.3 icmp_seq=2 Destination Host Unreachable
From 192.168.0.3 icmp_seq=3 Destination Host Unreachable
From 192.168.0.3 icmp_seq=4 Destination Host Unreachable

Last edited by barghota; 07-18-2005 at 06:48 PM.
 
Old 07-18-2005, 09:46 PM   #4
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
you need to setup bridging (this would require custom kernel with CONFIG_BRIDGE=y)
 
Old 07-19-2005, 04:07 AM   #5
barghota
Member
 
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94

Original Poster
Rep: Reputation: 38
I made it once without bridging the the network was fine, i just want eth1 to ping eth0, if someone could plzz give me a hint.
 
Old 07-19-2005, 07:11 AM   #6
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
then try NAT
 
  


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
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 02:30 PM
Problem with two nics juanb Linux - Networking 1 08-31-2004 08:07 AM
Problem routing between 2 nics linuxdoctor Linux - Networking 3 08-17-2004 06:18 PM
Problem with multiple NICs luky2k Linux - Networking 4 11-21-2003 10:24 AM
Multiple NICS Problem sam0010 Linux - General 3 06-27-2003 10:10 PM

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

All times are GMT -5. The time now is 08:31 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