My question seems to be quite simple, yet I can't just wrap my head around it. My setup is like this:

Server running RHEL 6.4. It has two network interfaces:

ib0: infiniband network (plz don't ask why :), most of the servers are here. IP:

eth0: ethernet network, end-users are here (and a few servers). IP:

This server serves as a gateway between servers and users. It has a standard ip forwarding enabled:

net.ipv4.ip_forward = 1

...and nothing else. It is working just fine, no complaints here.

So now I need to do the following: both users from network and servers from network need to access an external network This network is managed by another department - they've deployed a router on their side and provided me with a physical link. Their router has an ip

So, I set up a static route on my gateway server like this:

ip route add via

...and my end-users from network are able to access However, servers from network are unable to reach it.

I am not really great with routing and networking in general, so I suspect I should have NAT enabled for my network (??), but my head starts to ache really bad when I am reading iptables manual... Also, the thing is, that this server should continue to act as a gateway between infiniband and ethernet networks, preferably, with as little overhead as possible.

So the question is: how do i do it?

  • 1
    Simple question, does the router at know the network ?, thus a route back – yagmoth555 May 6 '15 at 13:05
  • Nope, the router doesn't know about So I guess, I need to do some NATing? – Tigran Baluyan May 6 '15 at 13:13
  • 2
    No, please add a route to in the router. I would not NAT, that can bring you other problem. – yagmoth555 May 6 '15 at 13:17
  • Unfortunately, I can't do that - the router is not managed by me, and I do not have any access to it. – Tigran Baluyan May 6 '15 at 13:23
  • Call the one that manage it ? :) or change the main router to add the route over that router. as that router talk to it's default route, and a ICMP Redirect will send him back to you. – yagmoth555 May 6 '15 at 13:23

Ok, so, through countless errors managed to get it working using iptables NAT.

Here are the config lines in my /etc/sysconfig/iptables:

-A POSTROUTING -s -d -p tcp -o eth0 -j SNAT --to-source 
-A POSTROUTING -s -d -p udp -o eth0 -j SNAT --to-source

That did the trick. Hope that it will help someone.

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.