Linux and Windows IT Support  


Windows, Apple and Linux IT support and services.

For Software and Web Development.

Connecting one system to multiple networks


Q. I have a Linux server that connects to the external network and internal. Both network cards have a gateway. How can I set it up, so that it can access both networks?

A. You would need to set up source routing. This can be done fairly easily, following those steps:

Open up /etc/iproute2/rt_tables, add those two at the bottom: 

1 first 
2 second

Open up /etc/rc.local add the following (before exit 0):

ip route add dev eth0 src table first
ip route add default via table first
ip route add dev eth1 src table second
ip route add default via table second
ip rule add from table first
ip rule add from table second

Network 1 information:


Network 2 information:

It doesn't really matter if one network is external and the other internal in this setup, you can pick either one and replace the values with your own settings. 

Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
Copyright © 1999 - 2022 Virtual Helpme | Trusted IT Services | Original Template: Allrounder