Click to See Complete Forum and Search --> : Two Networking Card and Two Subnet IP Proplem
Lawes
05-09-2003, 05:57 AM
Dear all,
Can help me to solve the following case ?
If I have 2 true subnet IP , let say, 210.133.x.x for eth0 and 202.64.x.x for eth1
I can success access the eth0 because I have set the default gw belong to eth0.
however, I can't access 202.64.x.x from outside world( eth1 card) I use tcpdump to trace the problem. It show me that eth1 can receive the packet but any response packet is sent through eth0
even I delete the delete default gateway and use "route add" command into the 2 network card. let say
route add -host 210.133.x.x gw 210.133.x.1 eth0
route add -host 202.64.x.x gw 202.64.x.1 eth1
It still can't success , do anybody know the solution ?
thx a lot
andysimmons
05-09-2003, 06:22 AM
Have you checked both interfaces with 'iptables -L'?
andysimmons
05-09-2003, 06:28 AM
You probably already checked this, but just in case...does each interface have a netmask specified? You can check with 'ifconfig'.
Lawes
05-09-2003, 06:35 AM
of course I have
internal network with the same subnet about the eth1 can access it
but outside world cannot
andysimmons
05-09-2003, 09:46 PM
If devices in your LAN can access eth1 without a problem, then your settings on the Linux box could be fine the way they are. What device(s) do you have between your ethernet interfaces and the outside world?
Lawes
05-10-2003, 12:43 AM
thx for help
however,
while I using the tcpdump command
I can get the following result
eth1 receive echo request
eth0 send echo reply
thus I think it is the routing problem since default gateway is set belong to eth0 subnet
andysimmons
05-10-2003, 06:24 PM
Ok, I see what you mean. The only other suggestion I have is to make sure IP forwarding is enabled. I'm pretty sure that is necessary (unless you are using ipchains) for routing to work properly. If you already have it enabled, there's nothing else I can think of.
Lawes
05-10-2003, 11:25 PM
anyway, thx for your help
I have try the forward enable, but ..........
Alex Cavnar, aka alc6379
05-11-2003, 05:51 AM
Question:
For your internal network, did you just pull that IP address out of thin air, or is it one that was given to you by an ISP or something?
It could be that there isn't a router that knows how to find your machine. It sounds like you just gave that interface an address and hoped people would hit it. IP addressing doesn't really work that way...
andysimmons
05-11-2003, 07:36 AM
Originally posted by Alex Cavnar, aka alc6379
...did you just pull that IP address out of thin air...
It could be that there isn't a router that knows how to find your machine.
No, the outside world is getting there fine. Check out his 2nd post about the tcpdump...there's no way a packet coming from a different network could be received on eth1 if the outside routers can't see him in the first place. If he were to send any information even just from eth0 to eth1 at the network layer, it would HAVE to hit the gateway to go look for that IP since those two IPs can't possibly exist on the same subnet (look at the first octet). It's just his internal routing that's all wacky.
Lawes, let me know if you figure this out...I'm really curious what's wrong here.
andysimmons
05-11-2003, 08:38 AM
Ok Lawes, this has been driving me nuts and I finally found something that might help you. If it doesn't, I'm going to stick another NIC in my computer tonight and try to get it working myself...anyway, I pulled this quote off of this page. (http://www.siliconvalleyccie.com/network-linux.htm#_Toc33893560)
The Linux box used in this example uses interface wlan0 for its connectivity. You may be most likely using interface eth0, please adjust your steps accordingly.
Add the new route as follows:
route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254 wlan0
The file etc/sysconfig/static-routes will also have to updated to reload this route when you reboot. Here is a sample.
wlan0 net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.254
Some people don't bother with this step and just place the "route add" command in the file /etc/rc.d/rc.local. A more complicated /etc/sysconfig/static-routes file is located in the following section.
jumpedintothefire
05-12-2003, 01:50 PM
Might want to give this a read:
http://www.samag.com/documents/s=1824/sam0201h/0201h.htm
turnbui
07-26-2005, 07:01 PM
If you managed to get this working do you have a write up / HOW-TO on what was necessary?
jumpedintothefire
07-26-2005, 07:18 PM
Check out this thread:
http://justlinux.com/forum/showthread.php?t=140010