Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Please provide the outputs of: # netstat -rn # ip route # iptables -L -n -v –  dmourati Jul 9 '12 at 0:14
    
pastebin.com/Krnr0Zs6 –  thefinn93 Jul 9 '12 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 '12 at 1:15
add comment

3 Answers

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?

share|improve this answer
    
Ok. What do you mean "what am i using to configure my network"? I have the default Ubuntu stuff installed for networking... –  thefinn93 Jul 8 '12 at 23:21
    
Ubuntu defaults are not sufficient for your use case. –  Magellan Jul 8 '12 at 23:24
    
Ok, so what do I do? –  thefinn93 Jul 8 '12 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 '12 at 23:44
    
And once that's working, I'd suggest go reading up on routing and forwarding. –  Magellan Jul 8 '12 at 23:46
show 2 more comments

Try:

ip route change default via 10.13.37.1 src 10.13.37.116
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.