Discussion Locked

NATting & Routing on Linux Box.

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a Linux box with 3 interface cards, eth0-a.a.a.1, eth1-b.b.b.1, eth2-172.16.1.1
eth 0&1 are on real IP from different ISP which are not connected by any medium(no BGP)
now my destination server is in private range 172.16.1.2, I'm doing natting for that on this linux box.
I want to nat my destination server from both the real IP ranges. I'm doing this with IPROUTE2. My problem is this If I nat from one IP then everything works fine but with both IP ranges situation goes bad. I think problem is due to default route on this system that returning packet goes from default route and that is from one IP range and second IP range lost on that.
So can we specify that if packet enters from eth0 then reply should goes back from the same and if comes from eth1 then eth1 should be returning path. A sort of source routing.
that mean system work without default route and packet goes from specific interface and next hop will take care for final destination.

1 reply

by dwilcox22

You may check your /etc/hosts.allow and hosts.deny file.Also verify that you have ip_fowarding on all of you cards. For some reason ip's are not being forwarded. In addition check your routing you may have to add your isp's to the route table.

This discussion is closed to new replies.