Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для misher

Пользователь


Сообщения: 103
Благодарности: 5

Профиль | Сайт | Отправить PM | Цитировать


По раннее предложенному варианту jail мог ходить на любой порт интерфейса tun0, но в остальных случаях он мог ходить только на 53 порт.

Вот такой вариант более ограничивающий:
nat on tun0 from 10.10.0.0/24 to any -> tun0
pass out quick proto tcp from 10.10.0.42 to any port 53 flags S/SA modulate state
pass out quick on tun0 from (tun0) to any keep state#Походу можно заменить на ниже преведенную строку
pass out on tun0 proto tcp from 10.10.10.42 to any port 53 keep state#кажется заменяет предыдущую строку
block quick log-all all



Поищите в интернете вот эту книжку:
Dev Guide - Building Firewalls with OpenBSD and PF
Вот полезный отрывок из нее:
Packets sent from NATed hosts appear as outbound packets on
the firewall interface used in nat rules. Their source address and source
port are changed to those of the firewall’s interface. Therefore, they are
matched by block out or pass out rules on that interface, e.g.:
# NAT hosts in the private network ($prv_ad) on the
# interface connecting the firewall to the Internet
# ($ext_if) using the firewall’s external address
# ($ext_ad)
nat on $ext_if from $prv_ad to any -> $ext_ad
pass out on $ext_if proto tcp from $prv_ad to any

-------
Где линукс пингвины висят
там черти БСД продолжают работать


Отправлено: 18:23, 26-06-2007 | #8