Привет всем
Возможно ли сделать так:
# uname -a
FreeBSD router 6.2-RELEASEИмеем на шлюзе 1-у сетевую карту, через неё подключаюсь к АДСЛ модему и получаю tun0 интерфейс, так же через неё подключены другие компьютеры...
Возможно ли настроить НАТ для такой схемы?
# cat /etc/pf.conf
ext_if="tun0"
int_if="vr0"
table <inat> { 192.168.106.0/24 }
set skip on lo0
nat on $ext_if from <inat> to any -> ($ext_if)
pass all
# ipfw show
00100 0 0 allow ip from any to any via lo0
65000 69410 31171206 allow ip from any to any
Пинг с клиентской машины
# tcpdump -N -n -i tun0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type NULL (BSD loopback), capture size 96 bytes
13:37:24.773642 IP 192.168.106.110 > 195.5.19.174: ICMP echo request, id 512, seq 50944, length 40
13:37:30.274220 IP 192.168.106.110 > 195.5.19.174: ICMP echo request, id 512, seq 51200, length 40
13:37:35.774480 IP 192.168.106.110 > 195.5.19.174: ICMP echo request, id 512, seq 51456, length 40
13:37:41.275065 IP 192.168.106.110 > 195.5.19.174: ICMP echo request, id 512, seq 51712, length 40
13:37:41.488588 IP 91.124.183.172.4454 > 91.124.106.19.445: S 3805371198:3805371198(0) win 8760 <mss 1400,nop,nop,sackOK>
^C
5 packets captured
5 packets received by filter
0 packets dropped by kernel
# cat /etc/rc.conf | grep -v '#'
keymap="ru.koi8-r"
usbd_enable="NO"
ifconfig_vr0="inet 192.168.106.54 netmask 255.255.255.0"
gateway_enable="YES"
sshd_enable="YES"
hostname="router"
ppp_enable="YES"
netgraph_enable="YES"
pf="YES"
pf_rules="/etc/pf.conf"
pflog_enable="NO"
pflog_logfile="/var/log/pflog"
pflog_flags=""
accounting_enable="YES"
clear_tmp_enable="YES"
syslogd_enable="YES"
nfs_server_enable="NO"
nfs_client_enable="NO"
portmap_enable="NO"
tcp_extensions="NO"
tcp_drop_synfin="YES"
inetd_enable="NO"
icmp_bmcastecho="NO"
icmp_drop_redirect="YES"
icmp_log_redirect="YES"
tcp_restrict_rst="YES"
fsck_y_enable="YES"
update_motd="NO"
rpcbind_enable="NO"
syslogd_flags="-ss"
fsck_y_enable="YES"
router_flags="-q"
router="/sbin/routed"
router_enable="NO"