Multi-NAT setup
Any one have any info,links,etc on setting up a 'Many to Many No Overload' Multi-NAT router.
I have two networks that i wish to bridge with a NAT router, i want some PC to have access to services on the other network but they need specific IP addresses. e.g. 172.16.46.1 <-> 200.0.0.1 (don't ask why it's a 200 range it a long story) 172.16.46.2 <-> 200.0.0.2 172.16.46.3 <-> 200.0.0.3 172.16.46.4 <-> 200.0.0.4 etc.... I far as my understanding goes it will require 2 network cards with multiple IP on each and then some clever IPtables rules to do the translation. |
Done some more research and found out the this is also called one-to-one Nat (multi-nat is a netgear name).
So it should be possible to do using just iptables rules. Any ideas? |
hi...
you're right, for a single host (with eth0 your interface to internet), it goes like this: Code:
iptables -t nat -A PREROUTING -i eth0 -d 200.0.0.1 -j DNAT --to-destination 172.16.46.1 First line do the translation on the way from internet to LAN Second line do it the other way around Third line creates an alias on eth0 so that your gateway answers to arp queries and accept ip traffic to this IP as well as to its own. |
Excellent...thank you for your help.
With a little tweaking (coz im using two network cards) i have got this working perfectly. After managing to pull this off I can no longer class myself as a newbie, but still a long way from guru. |
All times are GMT -5. The time now is 01:51 AM. |