Facebook Twitter VK
MailОбратная связь

E-Mail, телефон

CallВызов мастера

Sergey30-10-2016


Источник http://pcvector.ru/t1940

https://habrahabr.ru/post/111580/

http://serveradmin.ru/nastroyka-shlyuza-na-freebsd-10/

В ядро:

options IPFIREWALL

options IPFIREWALL_DEFAULT_TO_ACCEPT

#options IPFIREWALL_FORWARD #depricates

options IPFIREWALL_VERBOSE

options IPFIREWALL_VERBOSE_LIMIT=50

options IPFIREWALL_NAT

options LIBALIAS

options IPDIVERT # Need for natd or other divert actions

В /etc/rc.conf добавляем

firewall_enable=«YES»

firewall_nat_enable=«YES»

firewall_type="Simple"

gateway_enable=«YES»

В /etc/sysctl.conf добавить:

net.inet.ip.fw.one_pass=1

em0 – внешний интерфейс

192.168.0.0/24 – внутренняя сеть

200.200.200.200 – внешний адрес

Пример:

/sbin/ipfw add nat 1 config log if em0 reset same_ports

/sbin/ipfw add nat 1 ip from 192.168.0.0/24 to not table(10) via em0

/sbin/ipfw add nat 1 ip from any to 200.200.200.200 via em0

Где table 10 – не идет через нат

Некоторую статистику можно посмотреть так:

ipfw nat 1 show