LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2016, 05:54 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Help about routing.


Hello.
In CentOS final version, 4 NICs exist and a problem happened that all traffic routing and passing via one NIC. How we can find the root of problem?

Thank you.
 
Old 12-21-2016, 06:20 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,402

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
Quote:
Originally Posted by hack3rcon View Post
Hello.
In CentOS final version, 4 NICs exist and a problem happened that all traffic routing and passing via one NIC. How we can find the root of problem?

Thank you.
Please explain more. How and why is that a problem?

How many of the NICs are connected to networks? Has each NIC been given an IP address? Are these addresses on different networks, or all on the same network?

What did you do, and what are you TRYING to do?

Without adequate detail and context, there is nothing here to indicate that there IS a problem, much less what the problem might BE.
 
Old 12-21-2016, 09:24 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,553
Blog Entries: 4

Rep: Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888
To elaborate on possibilities: start by entering the route command. This will display the "routing table" which will consist of zero-or-more routing entries and a "default route."

Each routing table entry will specify an IP address, a "netmask" (where "255" indicates that the corresponding part of the IP-address is considered and "0" means that the part is ignored), a gateway IP-address (e.g. the address of your home router), and the interface to which traffic matching that route will be sent. Anything which doesn't match a routing-table entry will use the default route.

TCP/IP and UDP traffic will make one or more "hops" to get to its final destination, and there must be correct routing (going and coming ...) at each "hop."

This does ordinarily mean that all traffic bound for a certain place will go through a single NIC, unless you are also running some kind of load-balancer to distribute it otherwise. (For instance, main-line Internet backbone routers do use "traffic shaping" to spread out the vast amount of traffic that they are designed to carry.) Packets are routed independently: two consecutive packets may travel to their destination by a different route.

Commands such as traceroute are useful for observing the path taken by one packet ... and for discovering "return-routing" problems because they prevent this command from doing its job.

tcpdump, or WireShark, will allow you to see the packets as they come and go. (Even if they are encrypted so you can't read them, you can still see them.)

The most important tool that I have for resolving networking issues is a legal-pad and a number-two pencil. Draw a picture of what the route should look like, then work out what it now does look like.

Last edited by sundialsvcs; 12-21-2016 at 09:32 AM.
 
Old 12-21-2016, 09:25 AM   #4
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by wpeckham View Post
Please explain more. How and why is that a problem?

How many of the NICs are connected to networks? Has each NIC been given an IP address? Are these addresses on different networks, or all on the same network?

What did you do, and what are you TRYING to do?

Without adequate detail and context, there is nothing here to indicate that there IS a problem, much less what the problem might BE.
Thank you a lot.
Let me examine it more. We have two PCs with 4 NICs. Each PC has two NICs. When I use eth0 from PC1 for send packet to PC2 then PC2 reply me with eth1 not eth0. Why? What is my problem?
 
Old 12-21-2016, 04:33 PM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,402

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
Quote:
Originally Posted by hack3rcon View Post
Thank you a lot.
Let me examine it more. We have two PCs with 4 NICs. Each PC has two NICs. When I use eth0 from PC1 for send packet to PC2 then PC2 reply me with eth1 not eth0. Why? What is my problem?
I see. The problem is that you do not understand TCP/IP networking well enough.
I take it that each one has ETH0 or the first NIC connected to your internal network, but the second NIC (eth1 perhaps) directly connected to the other host?
If that is the case, the two need TWO networks defined. One is your internal network, generally with a default route to reach anything not defined ON the internal networks. The second is a different subnet and network that is just shared between the two servers on that shared connection.

As an example, if we assume your internal network is a class C (mask 255.255.255.0) network 192.168.1.x with a default route at 192.168.1.1 your ETH0 addresses might be 192.168.1.10 and 192.168.1.11. The other network might be 10.10.10.x with subnet mask 255.255.255.0 and the ETH1 addressed at 10.10.10.1 and 10.10.10.2. You simply address each server by the 10.10.10.x address to use that shared connection.

Now, let us talk about FQDns and hostnames. We treat hostnames and FQDN (Fully Qualified Domain Names) as if they were server names, and one primary normally IS. That is partly wrong. The hostname is normally related to or the same as the Primary FQDN, but a FQDN is an ADDRESS indicating a NIC INTERFACE. If you want to address by name, then your name server or host file (depending upon which you are using for this connection) needs to resolve a unique name to the shared IP addresses for those interfaces. If you then use the right NAME to address the server, the traffic will be roouted to the interface that serves that network and your traffic will flow as you expect.

Believe it or not, that is the SHORT and SIMPLE version. I could go into great detail for several pages about routing, name services, and network configuration (I do this for a living) but it would be more than you need to know and might make both of our brains explode.

Consider this, see how you have your addressing configured, and you may be able to solve this yourself in good order. IF you CANNOT, come on back and tell me what you have and how it is not working, and we will take another swing at it.
 
1 members found this post helpful.
Old 12-24-2016, 02:26 AM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by wpeckham View Post
I see. The problem is that you do not understand TCP/IP networking well enough.
I take it that each one has ETH0 or the first NIC connected to your internal network, but the second NIC (eth1 perhaps) directly connected to the other host?
If that is the case, the two need TWO networks defined. One is your internal network, generally with a default route to reach anything not defined ON the internal networks. The second is a different subnet and network that is just shared between the two servers on that shared connection.

As an example, if we assume your internal network is a class C (mask 255.255.255.0) network 192.168.1.x with a default route at 192.168.1.1 your ETH0 addresses might be 192.168.1.10 and 192.168.1.11. The other network might be 10.10.10.x with subnet mask 255.255.255.0 and the ETH1 addressed at 10.10.10.1 and 10.10.10.2. You simply address each server by the 10.10.10.x address to use that shared connection.

Now, let us talk about FQDns and hostnames. We treat hostnames and FQDN (Fully Qualified Domain Names) as if they were server names, and one primary normally IS. That is partly wrong. The hostname is normally related to or the same as the Primary FQDN, but a FQDN is an ADDRESS indicating a NIC INTERFACE. If you want to address by name, then your name server or host file (depending upon which you are using for this connection) needs to resolve a unique name to the shared IP addresses for those interfaces. If you then use the right NAME to address the server, the traffic will be roouted to the interface that serves that network and your traffic will flow as you expect.

Believe it or not, that is the SHORT and SIMPLE version. I could go into great detail for several pages about routing, name services, and network configuration (I do this for a living) but it would be more than you need to know and might make both of our brains explode.

Consider this, see how you have your addressing configured, and you may be able to solve this yourself in good order. IF you CANNOT, come on back and tell me what you have and how it is not working, and we will take another swing at it.
All PCs are in a same network. Each PC has two NICs with range 192.168.1.X. When I ping PC-2 from PC-1 then eth1 on PC-2 reply me not eth0.
For example, eth0 on PC-1 has an IP like 192.168.1.2 and eth0 on PC-2 has 192.168.1.4, when I ping 192.168.1.4 then eth1 on PC-2 reply to it!!!!
 
Old 12-24-2016, 02:37 AM   #7
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,748

Rep: Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137
Why don't you give us the full picture? For each PC...
Code:
ip add
Code:
ip route
 
Old 12-25-2016, 06:13 AM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,402

Rep: Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622Reputation: 2622
From his reply, we may not need that (though it would be nice).

OP: you can have only ONE default route. There can be many static and dynamic routes, but only one default. That route can only be to a single IP address via a single interface. Having more interfaces addressed on the same subnet does not change the default route interface.

How do you get around this to use more interfaces? One way is to use the subnet separation as I described. This puts the shared ports on a shared subnet and results in the traffic between the two hosts routing via that shared connection. Another is Port Binding, to make multiple interfaces look like one. This can be done using the bridging tools, but if you have to ask THIS question then binding might be a little ambitious.

Allow me to ask this question: Why do you want or need the second NIC interfaces on these boxes activated? What is your objective here? Normal communication using a single internal subnet does not require more than one interface, so you must have some non-standard purpose or goal. We need to understand the objective to help you achieve that goal, or everything said here so far is just so much (hopefully educational) noise.
 
Old 12-26-2016, 03:56 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,553
Blog Entries: 4

Rep: Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888
Yes, there is no reason to have two NICs on the same subnet. One computer does not need to have more than one network presence.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
routing protocol in vehicular ad hoc network for delivery routing message Adaramola ojo jayeola Linux - Wireless Networking 1 06-03-2016 07:07 AM
VPN not routing through server but still local routing pptpd narnie Linux - Server 1 01-21-2014 07:03 PM
Application specific routing (not routing p2p over vpn) tkalfaoglu Linux - Networking 1 06-15-2013 07:33 AM
Mutiple IPs and network cards routing (source policy routing?) shogun1234 Linux - Networking 1 01-17-2013 01:09 AM
Dynamic routing isn't done; static routing works for about 2 seconds for wireless gregorian Linux - Networking 7 02-19-2010 07:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration