Updated at the bottom

I'm using Centos as a router, and just replaced the routing system at work. I've got 2 routers to send data around. For the most part it's working. On one router I have 2 network ranges that are on the same nic (eth1). We have a server on one range, and anyone in the other cannot SSH to it. But, it can be pinged.

Here's a quick layout:

Internet Link:

eth0 - (link between routers)
eth1 - - (10.10.10.x and 10.10.11.x ranges)
eth2 - internet

Router 2:

eth0 - (link between routers)
eth1 - & ranges (yes, I know is not for private use, this is a legacy setup that we haven't been able to remove yet)

Here is the ip route printout: dev eth1  proto kernel  scope link  src dev eth0  proto kernel  scope link  src dev eth1  proto kernel  scope link  src
default via dev eth0

The server is on I have a laptop running on I get a response from the command: ping But, when I try to ssh to it, I get nothing. Through doing some tcpdump commands on my routers, I'm seeing that the packets for the ssh command are going from the laptop, to the internet router ( and back to the correct router.

My iptables list is empty. You can see my ip route output above. Any ideas? I've been staring at this all day. The way I understand it, is that the router should send the packet back through eth1 for to pick up. Thanks.

Edit: Scratched out the bouncing part. I realized that I was seeing ssh traffic from my ssh session into the router, and attributed it to my ssh request.

Update I separated my setup. Now 98.0.0.x is on eth1 and 10.98.0.x is on eth2. What I'm seeing isn't making much sense though.

When I ping the server from my laptop, I get a reply. The route it is taking is odd. It goes through the default route to (internet router) and back through to (tcpdump on eth0 of the internet router found this)

One tidbit. When I started the project, I was trying to do policy routing to make 2 internet providers work. Is there something related that could be doing this?

Here's my updated layout for the second router

eth0 - (router link)
eth1 - / 24
eth2 - /24

and ip route show dev eth1  proto kernel  scope link  src dev eth0  proto kernel  scope link  src dev eth2  proto kernel  scope link  src
default via dev eth0

As you are telling like you are getting ping replies from server, then it might be possible that iptables rules applied on your server, so that the server dropping ssh connection.

If you are authorized to see the server iptables rule then check it. There would be a rule for dropping ssh connection.

  • No, because people in the 98 range have no problem. Nor do we have issues connecting from the other router. – B Ronk Feb 19 '13 at 4:52
  • it might be possible they are dropping only input ssh connections.... – P4cK3tHuNt3R Feb 19 '13 at 4:57
  • No. The iptables on this system are flushed at boot to make sure nothing like that happens. They are completely empty. – B Ronk Feb 19 '13 at 5:08
  • in fact, if I use the default rc.local script without flushing, nothing works correctly. – B Ronk Feb 19 '13 at 13:18

I found the answer. I added NAT to each nic:

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

Once I did this, everything started working correctly. Thanks everyone!

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.