Article Taggé NAT

Natting a network range with NETMAP+Iptables

Some times we need to do a 1 to 1 NAT of a network range depending upon a condition (the destination network for example).
For example, you have the 192.168.1.0/24 network and you would like to NAT each IP to its equivalent in 192.168.2.0/24 when the packet travels through the NAT device (so 192.168.1.100 becomes 192.168.2.100).

If you use Netfilter as a NAT device or gateway you can use the NETMAP module like this :

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 10.1.1.0/24 -j NETMAP --to 192.168.2.0/24

I think that’s clear enough :-)

Add comment 24 mars 2009


Widgets

Mots-clefs

802.1x Active Directory BSCI CCDA Cisco Debia domU Debian DNS ESX Failover LoadBalancing file permission Firewall Gateway First-Hop HA HSRP VRRP IPSec ISO keepalived LAN access Linux LiveCD NAT Netfilter netwo Network Para-virtualisation Redundancy Routing SSH svn vim VMKnoppix VPN VRRP word completion Xen

Commentaires récents

capcorne sur Deploying 802.1x for LAN …
feroz sur Deploying 802.1x for LAN …
capcorne sur Install a Xen PV domU from CD …
capcorne sur Gateway High Availability

Méta

Blog Stats

Archives