-1

I have several computers all connected to the same switch. Some computers are running RHEL, one is running CentOS.

The CentOS machine is connected with NIC 2 to switch 2, and NIC 1 to switch 1.

The RHEL machines are connected to switch 1.

Both switches are "unmanaged".

The CentOS machine has 2 NICs, I want to use the second NIC to connect to the switch with the RHEL machines. Please see attached picture:

enter image description here

The CentOS machine is connected to switch 1 with NIC 1 just so that we can quickly transfer files between the CentOS machine and the RHEL machines. The CentOS machine is connected to Switch 2 with NIC 2 because our department IT won't let it be connected to switch 1 for outside internet access. We want to use NIC 1 for local file transfers.

I'm wondering how to have the RHEL machines and the CentOS machine realize that they are connected on the same switch when transferring files. I am trying to accomplish this by using the second NIC on the CentOS machine.

I've tried setting both NICs to different static IP addresses. I set both to the same static IP address, it partially worked, but then connection through NIC 1 started working, connection through NIC 2 stopped working.

The CentOS computer doesn't have access to the DHCP server through switch 1. All of the RHEL machines through switch 1 are connected to the same DHCP server and we don't have administrative access to it. The problem is we can't connect the CentOS computer directly through switch 1 to the RHEL computers

10
  • 1
    The CentOS machine is connected to switch 1 just so that we can quickly transfer files between the CentOS machine and the RHEL machines. The CentOS machine is connected to Switch 2 because our department IT won't let it be connected to switch 1. - These two statements contradict each other. Commented Apr 16, 2014 at 21:59
  • 1
    What have you tried and what did not work? This is a bog-standard network design for multihoming a system to multiple networks, there's nothing out of the ordinary I can see here. Commented Apr 16, 2014 at 22:08
  • I don't see where you describe any problem. You say you tried setting both NICs to different static IP addresses. Presumably that didn't work or you wouldn't be asking the question, right? So what went wrong? What is the actual problem? Are these two different networks or are these two switches in turn switches to each other? Commented Apr 16, 2014 at 22:44
  • @DavidSchwartz, The CentOS computer doesn't have access to the DHCP server through switch 1. All of the RHEL machines through switch 1 are connected to the same DHCP server and we don't have administrative access to it. The problem is we can't connect the CentOS computer directly through switch 1 to the RHEL computers. Commented Apr 16, 2014 at 23:07
  • 1
    Ask for an IP address on the same subnet as the RHEL machine you want to talk directly to. If that's not an option, then you'll need to give up the desire to talk directly and talk to it through a router between the two subnets. Commented Apr 16, 2014 at 23:30

1 Answer 1

1

Well to start with, the CentOS machine should have a different IP on each NIC.

It seems that that all of the servers are on the same subnet (please clarify). If this is the case, then you can force traffic to a specific nic by putting host routes on the CentOS server for the RHEL machines (assuming there are only a few this shouldn't be a problem). You should set the default gw to go via nic2 (route add default) and specific routes for each of the RHEL machines (route add ...). See the route man page for specific details.

If there are different subnets for nic1 and nic2, then yoonix's comment above is right, this is pretty standard and should just work.

10
  • The switches are on different subnets. The CentOS computer doesn't have access to the DHCP server through switch 1. All of the RHEL machines through switch 1 are connected to the same DHCP server and we don't have administrative access to it. Commented Apr 16, 2014 at 22:58
  • Well, you could manually assign an IP to the CentOS nic on switch 1 in the same subnet as the RHEL machines and then it could talk to them. Then on the nic on switch 2 you could either manually assign or use DHCP to get an IP for Internet access. Commented Apr 17, 2014 at 4:25
  • Yes, well IT doesn't want the CentOS machine on the same subnet as the RHEL machines because the RHEL machines are department managed and the CentOS machine is managed by my group. IT fears that having the CentOS machine managed by us and on the same subnet could introduce a security hole in their system because my group would be responsible for insuring the CentOS machine is secure (IT can't trust us to fully ensure this). Given that knowledge is that anything you can see that would work? Commented Apr 17, 2014 at 14:15
  • If the CentOS machine is not on the same subnet as the RHEL machines then you will have to go thru a router for them to talk. Switch 1 may have this functionality but from what you said IT prob. wont do this for you. You could connect from the RHEL machines (presumably on the Internet) to the public IP of the CentOS machine. This is kind of silly, going out to the Internet and back in, but it probably would satisfy your IT guys as the traffic would have to go through their firewalls. Commented Apr 17, 2014 at 15:12
  • MERM, I'm thinking what you mentioned already takes place, but not sure. The RHEL machines and CentOS machines can talk to each other, but through some higher level interface (of which I am not sure what exists). I want their to be a faster method of data transfer between the CentOS machine and the RHEL machines by connecting the second NIC of the CentOS machine to the same switch as the RHEL machines. Right now the connection when transferring files is relatively slow (much slower than transferring data between RHEL machines). Commented Apr 17, 2014 at 15:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.