LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-19-2018, 12:39 PM   #1
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Rep: Reputation: Disabled
Multiple Subnets same Eth. No PINGS !


Hi,


I have configured 3 different IP's on the same ETH:

eth0 Link encap:Ethernet HWaddr 00:50:56:A2:19:4C
inet addr:192.168.0.19 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:57565234 errors:0 dropped:0 overruns:0 frame:0
TX packets:54922960 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12028012936 (11.2 GiB) TX bytes:11920605780 (11.1 GiB)

eth0:1 Link encap:Ethernet HWaddr 00:50:56:A2:19:4C
inet addr:172.24.249.154 Bcast:172.24.249.155 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:2 Link encap:Ethernet HWaddr 00:50:56:A2:19:4C
inet addr:172.22.166.194 Bcast:172.22.166.195 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:3 Link encap:Ethernet HWaddr 00:50:56:A2:19:4C
inet addr:172.22.166.154 Bcast:172.22.166.155 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1


The routes are:

Destination Gateway Genmask Flags Metric Ref Use Iface
172.24.249.152 0.0.0.0 255.255.255.252 U 0 0 0 eth0
172.22.166.192 0.0.0.0 255.255.255.252 U 0 0 0 eth0
172.22.166.152 0.0.0.0 255.255.255.252 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0



The interfaces are good:

ping -c 2 172.24.249.154
PING 172.24.249.154 (172.24.249.154) 56(84) bytes of data.
64 bytes from 172.24.249.154: icmp_seq=1 ttl=64 time=0.067 ms
64 bytes from 172.24.249.154: icmp_seq=2 ttl=64 time=0.054 ms

ping -c 2 172.22.166.154
PING 172.22.166.154 (172.22.166.154) 56(84) bytes of data.
64 bytes from 172.22.166.154: icmp_seq=1 ttl=64 time=0.085 ms
64 bytes from 172.22.166.154: icmp_seq=2 ttl=64 time=0.040 ms

ping -c 2 172.22.166.194
PING 172.22.166.194 (172.22.166.194) 56(84) bytes of data.
64 bytes from 172.22.166.194: icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from 172.22.166.194: icmp_seq=2 ttl=64 time=0.052 ms


But just the first one can ping to his gateway:

ping -c 2 172.24.249.153
PING 172.24.249.153 (172.24.249.153) 56(84) bytes of data.
64 bytes from 172.24.249.153: icmp_seq=1 ttl=255 time=0.389 ms
64 bytes from 172.24.249.153: icmp_seq=2 ttl=255 time=0.497 ms


the other ones:


ping -c 2 172.22.166.193
PING 172.22.166.193 (172.22.166.193) 56(84) bytes of data.
From 172.22.166.194 icmp_seq=1 Destination Host Unreachable
From 172.22.166.194 icmp_seq=2 Destination Host Unreachable

ping -c 2 172.22.166.153
PING 172.22.166.153 (172.22.166.153) 56(84) bytes of data.
From 172.22.166.154 icmp_seq=1 Destination Host Unreachable
From 172.22.166.154 icmp_seq=2 Destination Host Unreachable


I try to see the icmp traffic with TCPDUMP but just the first one have "traffic"


so what is the problem ? if I restart the server and I configure just the number 2, it works !


Best regards

Last edited by melquisedec; 06-19-2018 at 12:43 PM.
 
Old 06-19-2018, 02:26 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
How do you create eth0:1 interface?
 
Old 06-19-2018, 03:24 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
I wouldn't think one can define three different subnets on the same NIC...there is only one cable, after all. How can that be connected to three different networks?

I'm guessing that the one that works is the one that's configure in the same subnet as the gateway.

Mayhaps someone who knows will jump in.
 
Old 06-19-2018, 09:38 PM   #4
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
@nini9

I have created with ifconfig:

ifconfig eth0:1 172.24.249.154 netmask 255.255.255.252

ifconfig eth0:2 172.22.166.154 netmask 255.255.255.252

ifconfig eth0:3 172.22.166.194 netmask 255.255.255.252


@scasey

the cable is connected to a switch at the same time with the gateways. Basically the idea is just share the medium.
 
Old 06-19-2018, 11:19 PM   #5
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
Do you have all routers in the same VLAN?

All Routers should be in the same vlan as your interface to get reply. Also check ARP response from router.
 
Old 06-20-2018, 07:59 AM   #6
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
@kaushalpatel1982


Yes, all routers are in the same VLAN. I can't Understand that just first IP get response, when I use TCPDUMP I can see just traffic of first IP. I don't know why de O.S don't "send" anything by the ETH, maybe there is some misconfiguration in the kernel.
 
Old 06-20-2018, 09:18 AM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
If you have mulitple IP addresses on one NIC, the IP that will be used is the one configured in the server.
I have one IP for mail, another for web server and ftp, others for DNS services, one exclusivly for ssh.
If I were to monitor the IP for mail, I'd not see any ftp or web traffic, for example.

Of course you are using different IPs in your ping command.

I seriously doubt there's an OS or kernel issue here.

What is in /etc/resolv.conf?
 
Old 06-20-2018, 09:43 AM   #8
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi Sean,

the /etc/resolv.conf has just my domain and DNS server. I have Firewalls with many virtual IP's with any trouble. I think the problem is in O.S because when I try ping to these gateways: 172.22.166.153 and 172.22.166.193, there is no activity in the ethernet ( I use tcpdump -I eth0 -n to check that). Obviously if you don't send anything to the LAN, it will no response.

Why Centos don't send anything through eth0 ? the ping just "died" in the O.S. What is really funny is the response to the broadcast address. Look tcpdump can "see" the icmp traffic to broadcast address like:

10:04:38.468523 IP 172.22.166.194 > 172.22.166.192: ICMP echo request, id 5231, seq 1, length 64
10:04:39.468369 IP 172.22.166.194 > 172.22.166.192: ICMP echo request, id 5231, seq 2, length 64
10:04:40.474902 IP 172.22.166.194 > 172.22.166.192: ICMP echo request, id 5231, seq 3, length 64


but there is any activity when I try to ping to gateway 172.22.166.193.


I can't understand!
 
Old 06-20-2018, 10:29 AM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
So you're saying only the configuration for eth0:1 is working? Right? That's not the "first" IP, it's the third one.
There must be an issue with the routing, or the switch, or the gateway then.

My server is CentOS, and all five of the IP addresses work just fine, including the one on eth0...but then, they are all in the same netblock. Still, that would say that having multiple IP addresses on one NIC is not a problem for the OS.

I really can't help you with your multiple netblocks on one NIC much...and I've never seen a switch used to connect one computer to multiple gateways. (which is not to say it can't be done...I've just never seen it). My troubleshooting mojo just says it's not the OS, or, probably, even the server. Look elsewhere.

Oh! Oh! Why do you not have eth0:0 set? Try that. Skipping the first sub-ifcfg could be a problem.
Put 192.168.0.19 on eth0
172.24.249.154 on eth0:0
172.22.166.194 on eth0:1
172.22.166.194 on eth0:2

Also, I'm not sure how to check the gateway values...my server has a default line with the gateway (again, all using the same gateway) How does one specify multiple gateways in the routing table?

[Edit: my 1,000th post! We be havin' fun now!!]

Last edited by scasey; 06-20-2018 at 10:31 AM.
 
Old 06-21-2018, 02:36 PM   #10
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I am not sure what is your exact requirement? The interface eth0:1 is VLAN interface name normally. If you use vconfig to create these three interfaces, such as eth0:10, eth0:11 and eth0:12. And then you can have multiple subnets on one physical interface, one on physical interface and other on VLAN interface.
 
Old 06-21-2018, 09:28 PM   #11
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
hi

@Sean: your idea unfortunately did works.

@nini09: I can't use Vlan because the other endpoints can't tagging his packets

This strange configuration has as goal, the connection between 3 SIP Trunks over the same Router of the same ISP. The ISP just give me a router with 3 different ports, so there is 3 different cables (of the same router) connected to the switch. Each cable has his own subnet but Cantos can't manage these kind of "situation".
 
Old 06-21-2018, 11:20 PM   #12
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
This might be the problem of ARP Flux. Run the commands given below :

Quote:
sysctl -w net.ipv4.conf.all.arp_announce=1
sysctl -w net.ipv4.conf.all.arp_ignore=2
Also do check at router side APR flux configuration.

Last edited by kaushalpatel1982; 06-21-2018 at 11:25 PM.
 
Old 06-23-2018, 01:39 PM   #13
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by melquisedec View Post
@Sean: your idea unfortunately did works.
Which idea? "unfortunately did works" ?
 
Old 06-25-2018, 06:34 PM   #14
melquisedec
LQ Newbie
 
Registered: Jun 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi @kaushalpatel1982

I'll try morning, the server hat:

sysctl -a | grep net.ipv4.conf.all.arp_ignore
net.ipv4.conf.all.arp_ignore = 0

sysctl -a | grep net.ipv4.conf.all.arp_announce
net.ipv4.conf.all.arp_announce = 0

Hi Sean,

you said:

"Oh! Oh! Why do you not have eth0:0 set? Try that. Skipping the first sub-ifcfg could be a problem.
Put 192.168.0.19 on eth0
172.24.249.154 on eth0:0
172.22.166.194 on eth0:1
172.22.166.194 on eth0:2"

I try to use eth0:0 like you suggest, but it doesn't work!
 
  


Reply



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
[SOLVED] Server on multiple VLANs server not responding to pings from non-local subnets markfox Linux - Networking 14 02-02-2024 03:59 PM
Destination Host Unreachable On Multiple eth and Multiple Gateway sangprabv Linux - Networking 7 05-28-2010 10:51 AM
local pings/apache2 sites work from outside. external pings/apt-get not working. BnrStnr Linux - Networking 5 02-25-2010 02:20 PM
Routing multiple subnets to multiple wans raven1000x Linux - Networking 1 03-10-2004 02:29 AM

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

All times are GMT -5. The time now is 10:12 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