2

I have an Ubuntu 14 server going with two NICs.

eth0 is connected to my management network and has an ip of 192.168.10.25/24

eth1 is connected to my client network for internet connectivity. It is set up DHCP.

I need to be able to reach the server via the management network, while at the same time it needs to get out to the world wide inter-webs to get new packages. I do not need the server to act as an internet gateway for other devices to reach the internet. It just needs to reach it on its own.

If I configure only eth0 with the gateway of 192.169.10.1, I can reach the server from inside my LAN just fine using SSH.

If I configure only eth1 with DHCP, I can get to the interwebs just fine.

I know enough to know that you can't have two gateways. So if I enable both ports, I make sure to take the gateway off of eth0. In my mind, this should tell the system that all the 192.168.10.x traffic still goes through eth0, everything else goes through eth1. But obviously, it's not working that way.

This has been very frustrating. I've been searching the Google all day today for solutions, and can't seem to find one that works.

1 Answer 1

0

You can try to add route when interfaces go up

Example:

put script in /etc/network/if-up.d/

# Check for specific interface if desired
[ "$IFACE" != "eth1" ] || exit 0
# Adding additional routes on connection
route add default dev eth1 via xxx.xxx.xxx.xxx
route add -net yyy.yyy.yyy.yyy/zz dev eth0
route add ...

This will probably route all traffice to eth1 except yyy.yyy.yyy.yyy/zz network.

You must log in to answer this question.

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