1

This is an Ubuntu 12.04 server install. I have multiple network cards, eth0 and eth1 lets call them. eth0 is connected to the internet, and all of my traffic goes through it, until eth1 gets plugged in. Then the machine tries to send everything through eth1, which for various and sundry reasons does not go out to the Interent. The only traffic it doesn't send through eth1 is traffic on eth0's subnet. It also will not accept inbound connections on eth0 from outside of eth0's subnet. I'd like all outbound traffic to go out eth0, but I'd like incoming connections from to either card from any subnet to work.

3
  • Please provide the outputs of: # netstat -rn # ip route # iptables -L -n -v
    – dmourati
    Jul 9, 2012 at 0:14
  • pastebin.com/Krnr0Zs6
    – Finn
    Jul 9, 2012 at 0:18
  • What's upstream from your Ubuntu box between it and the internet? You need something to do a NAT from your 10.13.37.x address. Also, what is 5.1.1.2? It is registered in Ukraine. You said you have eth1 but your server lists only a tun interface, which is software only, not physical. This conflicts with what you say above about "eth1 gets plugged in." There may be something wrong with your source IP address selection. linux-ip.net/gl/ip-cref/node155.html
    – dmourati
    Jul 9, 2012 at 1:15

3 Answers 3

5

The traffic will go according to the routing table.

If you don't want Internet bound traffic egressing a particular interface then you need to ensure there is no default route that uses that interface.

If both are valid paths but one is preferred then change the preference of one of them higher or lower.

What are you using to configure your network?

7
  • Ok. What do you mean "what am i using to configure my network"? I have the default Ubuntu stuff installed for networking...
    – Finn
    Jul 8, 2012 at 23:21
  • Ubuntu defaults are not sufficient for your use case.
    – Magellan
    Jul 8, 2012 at 23:24
  • Ok, so what do I do?
    – Finn
    Jul 8, 2012 at 23:27
  • You need to post your /etc/network/interfaces file in the body of the question. Someone should be able to help you then.
    – Magellan
    Jul 8, 2012 at 23:44
  • And once that's working, I'd suggest go reading up on routing and forwarding.
    – Magellan
    Jul 8, 2012 at 23:46
1

Try:

ip route change default via 10.13.37.1 src 10.13.37.116
0

You configure your dhcp server to assign your server as the default route for each subnet (gateway = server's ip of the same subnet) and in your server, you assign the default route to eth0.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .