Multiple Ethernet port issue

General support questions including new installations
Post Reply
Bking2nd
Posts: 1
Joined: 2016/11/09 20:26:47

Multiple Ethernet port issue

Post by Bking2nd » 2016/11/09 20:49:44

So I am fairly new to Linux administration but I have been thrown into a position that requires me to sometimes work on Linux servers. I have one issue that I am not sure how to handle. I am hoping someone can help. Here is the issue:

We have a Linux web-server running CentOS. It runs two websites on it. It is configured with two Ethernet ports, each configured and connected to different internal networks with different routers and external IPs.

My programmers are trying to work on a new feature and need to connect to a share on a Windows computer that is connected to one of the two internal networks. Every time we try to connect to that share or ping that computer, it doesn't show up. We determined it is because the server is trying to connect to it via the other Ethernet port connected to the second internal network.

How do we connect to a computer on Network A when the OS wants to use Network B?

I hope I explained it clear enough as it has been boggling our minds. I didn't set up the network and none of us knew there was a second network involved until now.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Multiple Ethernet port issue

Post by TrevorH » 2016/11/09 21:26:36

You need to set up routes for the traffic you want to go over the second interface. You can add them using e.g. ip ro add 10.100.1.0.24 via 10.100.0.1 dev eth1 or whatever your second interface is called. If you add the routes manually first and get it working then you can create a /etc/sysconfig/network-scripts/route-eth1 (e.g) file and put your ip route add command in that but minus the 'ip route add' portion of the command. You may also need to add ip rules and create a rule-eth1 file too to make those persistent.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply