Везде написано, что в новой версии ipfw включен nat
ну и сам exempleNETWORK ADDRESS TRANSLATION (NAT)
The nat configuration command is the following:
nat nat_number config nat-configuration
The following parameters can be configured:
ip ip_address
Define an ip address to use for aliasing.
if nic Use ip addres of NIC for aliasing, dynamically changing it if
NIC's ip address change.
log Enable logging on this nat instance.
deny_in
Deny any incoming connection from outside world.
same_ports
Try to leave the alias port numbers unchanged from the actual
local port numbers.
unreg_only
Traffic on the local network not originating from an unregistered
address spaces will be ignored.
reset Reset table of the packet aliasing engine on address change.
reverse
Reverse the way libalias handles aliasing.
proxy_only
Obey transparent proxy rules only, packet aliasing is not per-
formed.
To let the packet continue after being (de)aliased, set the sysctl vari-
able net.inet.ip.fw.one_pass to 0. For more information about aliasing
modes, refer to libalias(3) See Section EXAMPLES for some examples about
nat usage.
так вот читаю handbook часть про ipfw и вижу тамNAT, REDIRECT AND LSNAT
First redirect all the traffic to nat instance 123:
Код: Выделить всё
ipfw add nat 123 all from any to any
Так вот тут наступил ступор! Получается, что б включить NAT надо скомпилить ядро с "options IPDIVERT" при этом включается natd, ну а если хочеться не использовать natd, а по юзать nat встроенный в ipfw, какие опции нужно включать в ядро, то ????This enables the use of NAT functionality.Код: Выделить всё
options IPDIVERT
......
28.6.5.7 An Example NAT and Stateful Ruleset
There are some additional configuration statements that need to be enabled to activate the NAT function of IPFW. The kernel source needs 'option IPDIVERT' statement added to the other IPFIREWALL statements compiled into a custom kernel.
In addition to the normal IPFW options in /etc/rc.conf, the following are needed.
Код: Выделить всё
natd_enable="YES" # Enable NATD function natd_interface="rl0" # interface name of public Internet NIC natd_flags="-dynamic -m" # -m = preserve port numbers if possible
Али без natd ни куда?