![]() |
Server with 2 NIC's on different Networks
I've had this issue before and couldn't really resolve it but it's come back to bite me, so...
I have an old Debian Server (also same issue on Slackware as it happens) which has two network cards, configured as below; Code:
Code:
Kernel IP routing table Additionally, there is a specific IP of 10.29.42.103 which resides on the network to which eth6 connects and I am specifically having trouble sending and more so, receiving connectivity from it. I've tried adding a static route with; Code:
route add 10.29.42.103 dev eth6 Code:
Additionally, I have tried adding in the gateways for each of the interfaces (currently commented out above) and this changes the routing table to something like; Code:
Kernel IP routing table
Any help would be greatly appreciated. |
Hold on. 10.29.42.103 isn't on the same network as 10.28.10.0/24, so no way throwing it out there on the wire is going to work. If there is a gateway, you can forward the /32 to it, or the network (/24) to it. Defining it as default gateway isn't going to work 1/2 the time because you have the same metric on the interfaces. So it is going to round robin, try one interface then the next time the other.
So if you have a gateway to the 10.29.42.0/24 network, you have to define it as such. And that network needs a route back. |
#1 your initial config should work so that each of your subnets can be reached via the interface that lives on that subnet. I am confused about what you want that might require more than that, other than access to the internet. Since you have interfaces ON those subnets you would require a special filter or device to BLOCK you FROM receiving the traffic that lives on those subnets.
#2 To reach the internet you only need add ONE default gateway, and it can be on EITHER of the subnets (you should not need TWO, unless you are configuring a router or edge device). If you DO set two, you either need some special rules to channel traffic for a special purpose, or a trigger for exception conditions or routes. There are tricks one can play with complex configurations, but keeping it simple makes it more reliable. |
Two thoughts.
One is supernetting. Two is adding secondary ip to the nic in the desired subnet. |
All times are GMT -5. The time now is 09:30 PM. |