Книга: Iptables Tutorial 1.2.2

NETMAP target

закрыть рекламу

NETMAP target

NETMAP is a new implementation of the SNAT and DNAT targets where the host part of the IP address isn't changed. It provides a 1:1 NAT function for whole networks which isn't available in the standard SNAT and DNAT functions. For example, lets say we have a network containing 254 hosts using private IP addresses (a /24 network), and we just got a new /24 network of public IP's. Instead of walking around and changing the IP of each and every one of the hosts, we would be able to simply use the NETMAP target like -j NETMAP -to and voila, all the hosts are seen as 10.5.6.x when they leave the firewall. For example, would become

Table 11-11. NETMAP target options

Option --to
Example iptables -t mangle -A PREROUTING -s -j NETMAP --to
Explanation This is the only option of the NETMAP target. In the above example, the 192.168.1.x hosts will be directly translated into 10.5.6.x.

Note Works under Linux kernel 2.5 and 2.6.

Оглавление книги

Генерация: 1.019. Запросов К БД/Cache: 4 / 0
Вверх Вниз