1
0
I have two network cards and they both have a different network. I need the outgoing connections to go only through a specific network card. Any help ?
Update:
I ran a route -n
command and got this OP
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.100 0.0.0.0 UG 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
192.168.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
1The default gateway defines which next hop will be used for outgoing connections that are not otherwise routed, so this dictates which network interface they will exit given your two nics are on different networks. Is there more to this question? – Paul – 2012-11-21T11:43:22.213
Do you receive incoming connections from outside your networks on both interfaces? Otherwise, I just second Paul's observation. – pino42 – 2012-11-21T11:45:44.423
@paul thanks for the quick reply paul. I dont have not much knowledge on this stuff. i ran a route -n command and got this OP Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.100 0.0.0.0 UG 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1 192.168.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 – rahul – 2012-11-21T11:49:27.567
@Paul any help this time ? i want all the traffic to go via the card that has the 3.0/24 address --thanks in advance – rahul – 2012-11-21T11:54:39.477
@rahul: I've edited that update into your question where it is easier to read. – RedGrittyBrick – 2012-11-21T11:58:01.240
Rahul, are your network cards statically addressed or are they getting addresses via dhcp? Which network do you want the connections to go out of? What is IP of the router you want the connections to go out of? – Paul – 2012-11-21T12:05:54.947
@Paul the nics are static. I want the connections goin out to go through 3.0 network. (now it is goin through 1.0 network) – rahul – 2012-11-21T12:43:25.947
@Paul im stuck up at another issue now. The incoming connections need to go through the 192.168.1.X connection. Any help on this ? – rahul – 2012-11-27T06:10:22.083