LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   CentOS - Using Both NICs on different networks issue (https://www.linuxquestions.org/questions/linux-networking-3/centos-using-both-nics-on-different-networks-issue-4175481545/)

gh0stshell 10-20-2013 11:53 PM

[SOLVED]CentOS - Using Both NICs on different networks issue
 
First i would like to ya'll know i have a Debian based server that is working perfectly with what i am trying to do. My CentOS server is the one that when duplicating the config, but using different addresses does not work as wanted.

Debian setup

ETH0 > XXX.XXX.1.30 > 255.255.255.0 > XXX.XXX.1.1

ETH1 > XXX.XXX.3.30 > 255.255.255.0 > XXX.XXX.3.1

I can from a device on XXX.XXX.1.X network ping both XXX.XXX.1.30 and XXX.XXX.3.30 and access its services

CentOS setup

ETH1 > XXX.XXX.1.22 > 255.255.255.0 > XXX.XXX.1.1

ETH0 > XXX.XXX.0.22 > 255.255.255.0 > XXX.XXX.0.1

I can ping XXX.XXX.0.22 from a device on the XXX.XXX.1.X network and access its services, but as soon as i plug in ETH1 i can no longer PING 0.22 and i know i cant get to one of its services, but i cannot confirm all do not work once the 2nd NIC is plugged in.

Once the 2nd NIC is plugged in i can then PING XXX.XXX.1.22, but loose XXX.XXX.0.22

Also from the server i can PING both GW's, XXX.XXX.0.1 and XXX.XXX.1.1 and outside IP's and addresses.

FW rules are the same and i am guessing its something with the CentOS server since it only happens when i plug in the 2nd NIC and all is well until then.

Open to any ideas!

kbp 10-21-2013 04:38 AM

Quote:

ETH0 > XXX.XXX.1.30 > 255.255.255.0 > XXX.XXX.1.1
ETH1 > XXX.XXX.3.30 > 255.255.255.0 > XXX.XXX.3.1
It looks like you're configuring multiple default gateways? I'm not sure if this is doing what you expect it to do... theoretically the first nic to come up will define the default gateway and the one created by the second nic will not be used unless the first nic is unplugged.

When the kernel is attempting to route a packet it will read the route table from top to bottom and the first match will be used to forward the packet to.

Would you please confirm this is the functionality you expect?

gh0stshell 10-21-2013 10:31 PM

Quote:

Originally Posted by kbp (Post 5049536)
It looks like you're configuring multiple default gateways? I'm not sure if this is doing what you expect it to do... theoretically the first nic to come up will define the default gateway and the one created by the second nic will not be used unless the first nic is unplugged.

When the kernel is attempting to route a packet it will read the route table from top to bottom and the first match will be used to forward the packet to.

Would you please confirm this is the functionality you expect?

I am trying to get the functionality to act just as the Debian system does. Have both NICs plugged i with different addresses and GW's and be able to access either address on both subnets.

Why would this work on my Debian system, but not the CentOS system?

kbp 10-22-2013 01:47 AM

What I'm saying is independent of the distribution, having multiple default gateways is usually not desirable. You could end with asymmetric routes and unpredictable communication paths.

gh0stshell 10-22-2013 01:57 AM

It's working flawlessly on my Debian system

cospengle 10-22-2013 04:10 AM

Please post the routing table from both machines.

gh0stshell 10-23-2013 09:21 PM

Quote:

Originally Posted by cospengle (Post 5050244)
Please post the routing table from both machines.

here ya go

please keep in mind the centos server will be using 192.168.1.X and 192.168.0.X while the debian uses 192.168.1.X and 192.168.3.X

i found this which may be what i need

http://www.dfwavc.com/linux_multi_nic-multi_gateway

gh0stshell 10-24-2013 01:34 AM

Quote:

Originally Posted by cospengle (Post 5050244)
Please post the routing table from both machines.

Followed that guide, so far its not working, followed every step route still shows as what is outputted above for the CentOS server

SOLVED

baldy3105 10-30-2013 02:15 PM

Quote:

ETH1 > XXX.XXX.1.22 > 255.255.255.0 > XXX.XXX.1.1

ETH0 > XXX.XXX.0.22 > 255.255.255.0 > XXX.XXX.0.1

I can ping XXX.XXX.0.22 from a device on the XXX.XXX.1.X network and access its services, but as soon as i plug in ETH1 i can no longer PING 0.22 and i know i cant get to one of its services, but i cannot confirm all do not work once the 2nd NIC is plugged in.
How could you ping x.x.0.2 from x.x.1.x when x.x.1.x is on ETH1 which you imply was disconnected at the time? Plus your route table deosn't match this description.

gh0stshell 10-30-2013 11:11 PM

Quote:

Originally Posted by baldy3105 (Post 5055395)
How could you ping x.x.0.2 from x.x.1.x when x.x.1.x is on ETH1 which you imply was disconnected at the time? Plus your route table deosn't match this description.

I'm not following you

I re-read the OP and seems like your mis reading something, well i guess im magical when i can ping my device with an XXX.XXX.0.22 IP from my network with XXX.XXX.1.XXX

What is missing or incorrect?

i already figured out how to setup everything and have both NICs connected on separate networks and i can ping both IP's from any device on either network

How does my routing table not match my description?

To anyone having this issues PM me for help.

baldy3105 11-03-2013 11:41 AM

For future reference, if I ask a question I'm not trying to make you look stupid or wrong, I'm asking for information or clarification, in order to assist you with the question you came here to ask.

You might want to consider weather getting arsey with people who are trying to help you best serves your own interests.


All times are GMT -5. The time now is 04:34 PM.