Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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?
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.
@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".
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.