0

I have a very strange problem. A server has two IP addresses on a single network interface:

  • eth0 has 172.20.40.1
  • eth0:0 has 10.1.1.1

The address for eth0 is static, the one for eth0:0 comes from DHCP.

I can

  • ping anything on 10.1.1.0/24
  • SSH to any server on this subnet

but when I try to access other server resources, like a HTTP server, I get "No route to host".

This is my "ip ro li" output:

default via 10.1.1.254 dev eth0
10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.1 
172.17.0.0/16 dev docker0  proto kernel  scope link  src 172.17.42.1  
172.20.40.0/24 dev eth0  proto kernel  scope link  src 172.20.40.1 
192.168.17.0/24 dev usb0  proto kernel  scope link  src 192.168.17.1

What is wrong here?

  • Is working 10.1.1.254 as a router? (does it have ip forwarding enabled?) – KikoV Apr 28 '15 at 13:37
  • I'm more used to the route commands output, but it looks like you are pushing all traffic to 0.0.0.0 to 10.1.1.254, but doing so out the eth0 interface, not eth0:0. eth0 is not on the 10.1.1.x network, – Frank Thomas Apr 28 '15 at 13:50
  • Yes, it is. But I also get "No route to host" when I run a HTTP service on 10.1.1.254 and try to access it from 10.1.1.1. EDIT: How do I get to push out the traffic to eth0:0? – rabejens Apr 28 '15 at 13:51
  • well, on a dual-homed host, you only want to have one default gateway. to me it looks like its set on the wrong interface. the route to 10.1.1.x is also concerning. I'm beginning to wonder if Linux can deal with sub-interfaces. Do you have a second nic on the box? using eth1 rather than eth0:0 may be much simpler. At present it doesn't look like you have any routes out eth0:0, so that network will be inaccessible. – Frank Thomas Apr 28 '15 at 14:11
  • it looks like you are pushing all traffic to 0.0.0.0 to 10.1.1.254, but doing so out the eth0 interface, not eth0:0. eth0 is not on the 10.1.1.x network -- There is no difference between eth0 and eth0:0, the latter is just an alias, and not needed anymore using ip policy routing. As ssh does work, it's obviously not a routing problem. If one port does work and the other doesn't, you can be assured it's a firewalling issue. – wurtel Apr 29 '15 at 13:50
0

I solved it, It was Fedora's firewalld which caused this behaviour. I disabled it because we are in a secured company network anyway, and now it works.

| improve this answer | |
  • Interesting. I guess that implies that ip route list simply doesn't display sub-interface name correctly. Glad you got it working. – Frank Thomas Apr 28 '15 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.