1

I have created router between two subnets and installed centos on router.
Below are the configuration in my router :

  • eth0 : public ip (x.x.x.x)
  • eth1 : internal network gateway1 (150.15.1.1)
  • eth2 : internal network gateway2 (140.14.1.1)

Commands:

$ route add -net 150.15.1.0/24 gw 150.15.1.1
$ route add -net 140.14.1.0/24 gw 140.14.1.1

Forwarding is enabled as well: net.ipv4.ip forward=1

On both internal networks, corresponding gateways are defined. But still, we're unable to ping between two subnets.

Router :

[root@localhost ~]# iptables -L -n -v
Chain INPUT (policy ACCEPT 31 packets, 3122 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT (policy ACCEPT 26 packets, 2768 bytes)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD_IN_ZONES (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD_IN_ZONES_SOURCE (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD_OUT_ZONES (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD_OUT_ZONES_SOURCE (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FORWARD_direct (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDI_public (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDI_public_allow (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDI_public_deny (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDI_public_log (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDO_public (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDO_public_allow (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDO_public_deny (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain FWDO_public_log (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain INPUT_ZONES (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain INPUT_ZONES_SOURCE (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain INPUT_direct (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain IN_public (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain IN_public_allow (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain IN_public_deny (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain IN_public_log (0 references)
 pkts bytes target     prot opt in     out     source               destination
Chain OUTPUT_direct (0 references)
 pkts bytes target     prot opt in     out     source               destination
[root@localhost ~]# /sbin/sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

internal network 1

Network          Netmask             Gateway          Interface
140.14.1.11      255.255.255.255     140.14.1.1       vmk1 
140.14.1.0       255.255.255.0       Local Subnet     vmk1
150.15.1.0       255.255.255.0       140.14.1.1       vmk1
default          0.0.0.0             140.14.1.1       vmk1

internal network 2

Network          Netmask             Gateway          Interface
150.15.1.11      255.255.255.255     150.15.1.1       vmk1
140.14.1.0       255.255.255.0       150.15.1.1       vmk1
150.15.1.0       255.255.255.0       Local Subnet     vmk1
default          0.0.0.0             150.15.1.1       vmk1
  • 1
    Can you cut-and-paste into your question the output of iptables -L -n -v on the router? Can you also confirm that the relevant routes are set on each of the two endpoints? By the way, it's an extremely bad idea to use public IP addresses in a private context. – MadHatter Sep 24 '14 at 13:11
  • I haven't configured iptables only route the IPs.Please suggest how to route between eth1 to eth2.Also should I make the eth0 as private ip ? Yes,I configured two endpoint with eth1 and eth2 as gateways – Manikandan Kulandaivelu Sep 26 '14 at 4:51
  • I didn't ask if you'd configured iptables, I asked what the current ruleset was. If you could please cut-and-paste that into your question, we can dismiss it as a possible cause of the problem. It would be useful to see the routes from each endpoint, as well - as I often say, don't tell us what you've done; show us. – MadHatter Sep 26 '14 at 6:06
  • Ok.Updated the same.Let me know if you need anything else – Manikandan Kulandaivelu Sep 26 '14 at 7:22
  • It'd be helpful if you learned to use our markup mechanism (thanks, masegaloeh; you beat me to it by about 10s!). Also, you win "world's most complex pointless firewall ruleset" prize, but I agree, it doesn't look like those are the problem. However, I see this is a virtualised setup, which you kind of forgot to mention, and it's important. Can you confirm this, and provide details? – MadHatter Sep 26 '14 at 7:48

Your Answer

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

Browse other questions tagged or ask your own question.