1

I need to add a new route 10.10.10.0 and now I have this:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use  Iface
0.0.0.0         xx.xxx.xxx.1    0.0.0.0         UG    0      0        0 eth1
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 br0 
yyy.yyy.yyy.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
zz.zzz.zzz.104  0.0.0.0         255.255.255.248 U     0      0        0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br0

But from 192.168.1.0 I'm unable to ping 10.10.10.0

Can you give me some hints?

@Alex Berry:

 # netstat -rn
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
 0.0.0.0         xx.xxx.xxx.1    0.0.0.0         UG        0 0          0 eth1
 10.10.10.0      192.168.1.1     255.255.255.0   UG        0 0          0 br0
 xx.xxx.xxx.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
 yy.yyy.yyy.104  0.0.0.0         255.255.255.248 U         0 0          0 eth2
 192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 br0

# ifconfig
br0       Link encap:Ethernet  HWaddr 06:b3:9d:ea:00:00 
      inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1820084891 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1066013551 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:2430082718617 (2.2 TiB)  TX bytes:528068645043 (491.8 GiB)

 br1       Link encap:Ethernet  HWaddr 7e:c1:2c:b5:00:00  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 br2       Link encap:Ethernet  HWaddr ba:49:4e:ba:00:00  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 eth0      Link encap:Ethernet  HWaddr 3c:a8:2a:4c:00:00  
      UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
      RX packets:1819543139 errors:0 dropped:84145 overruns:0 frame:0
      TX packets:1069336958 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:2462699876337 (2.2 TiB)  TX bytes:532670076821 (496.0 GiB)
      Interrupt:17 

 eth1      Link encap:Ethernet  HWaddr 3c:a8:2a:4c:00:00  
      inet addr:xx.xxx.xxx.158  Bcast:xx.xxx.xxx.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1092047952 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1834312885 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:534554874442 (497.8 GiB)  TX bytes:2461099916046 (2.2 TiB)
      Interrupt:18 

 eth2      Link encap:Ethernet  HWaddr a0:36:9f:9a:00:00  
      inet addr:yy.yyy.yyy.106  Bcast:yy.yyy.yyy.111  Mask:255.255.255.248
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:12481216 errors:0 dropped:0 overruns:0 frame:0
      TX packets:16054960 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:2372738207 (2.2 GiB)  TX bytes:5865283466 (5.4 GiB)
      Memory:fbf00000-fbffffff 

 eth3      Link encap:Ethernet  HWaddr a0:36:9f:9a:00:00  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Memory:fbd00000-fbdfffff 

  lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:53089749 errors:0 dropped:0 overruns:0 frame:0
      TX packets:53089749 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:19502753983 (18.1 GiB)  TX bytes:19502753983 (18.1 GiB)

  tap0      Link encap:Ethernet  HWaddr 06:b3:9d:ea:00:00  
      UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
      RX packets:2911714 errors:0 dropped:0 overruns:0 frame:0
      TX packets:5922720 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:100 
      RX bytes:313722436 (299.1 MiB)  TX bytes:2727757262 (2.5 GiB)

  # iptables -L : there are to many rules here, it's a router box. no rules regarding 10.10.10.0

xx.xxx.xxx.0 and yy.yyy.yyy.104 are public ip's

  • Please give us your private ip ranges, no point in hiding them as we won't be able to route to them from here, it will also make it easier for us to diagnose the issue. Please state the IP address and subnet mask for each interface on that server, along with any subnets that you need to be able to route to and which gateways they lie behind. – Alex Berry Jun 08 '16 at 12:08
  • @AlexBerry all I need is to be able to ping from 192.168.1.1 (router LAN ip) to 10.10.10.2 192.168.1.0 / 255.255.255.0 is the router LAN interface br0 10.10.10.0 / 255.255.255.0 are the clients that needs to be pinged from 192.168.1.1 – Mihai Rusan Jun 08 '16 at 12:15
  • Is the above device a router or a client? It's not completely clear. Please post the output, directly, of the following commands: netstat -r ifconfig iptables -L (delete any sensitive information if necessary) – Alex Berry Jun 08 '16 at 12:16
  • also it appears that both the 10.10.10.0 and 192.168.1.0 subnets are connect via the same interface, without any vlan tagging etc. If this is true then your network design is not right, if it's not true and you actually have two different switch stacks, then perhaps you need to reconfigure the interface on the 10.10.10.0 route. – Alex Berry Jun 08 '16 at 12:20
  • Hi Mihai, please edit your original answer and post the contents of the requested output there, it's very hard to read as a comment. – Alex Berry Jun 08 '16 at 12:20
  • @AlexBerry please check the edit on original post – Mihai Rusan Jun 08 '16 at 12:28
  • apologies, the comment pushed to commands together, please run: netstat -rn ; ipconfig; iptables -L – Alex Berry Jun 08 '16 at 12:35
  • @AlexBerry please check again the post – Mihai Rusan Jun 08 '16 at 12:52
  • can the router ping hosts in the 10.10.10.0 range, and is the problem just isolated to the clients on the 192 subnet? If so it's likely an iptables issue. If the router cannot ping then it's likely a connectivity issue – Alex Berry Jun 08 '16 at 14:31

1 Answers1

0
ip route add 10.10.10.0 255.255.255.0 gw <router address>

where <router address> is a router that can both connect to/from the client and the target subnet.

Vasili Syrakis
  • 4,435
  • 3
  • 21
  • 29
  • You need gateway for both subnets so you need second route with gateway as well ip route add 192.168.1.0 255.255.255.0 gw also check this link [link](http://serverfault.com/questions/343472/set-static-default-route-in-a-router-in-linux) – Pavel K Jun 08 '16 at 09:07
  • You mean the default gateway which is most likely already in the routing table? – Vasili Syrakis Jun 08 '16 at 09:10
  • Take a look at routing table there are no gateways for both of your subnets though so it will try to use default gateway over br0 interface... – Pavel K Jun 08 '16 at 09:12
  • `xx.xxx.xxx.1` is also not a valid IPv4 address, so not much can really be said... – Vasili Syrakis Jun 08 '16 at 09:16
  • I added: route add -net 10.10.10.0 netmask 255.255.255.0 gw 192.168.1.1 dev br0 but still not working – Mihai Rusan Jun 08 '16 at 10:40