L2TP NAT и SIP
Добавлено: 20 ноя 2015, 11:33
User-123
Не могу разобраться с NAT'ом.
Есть два роутера соединённые l2tp. На одном сеть 172.16.16.0/16, на втором 192.168.5.0/16.
Из сети 172 адреса 192 пингуются, а наоборот - нет.
Не могу разобраться как пакеты гуляют.
Есть два роутера соединённые l2tp. На одном сеть 172.16.16.0/16, на втором 192.168.5.0/16.
Из сети 172 адреса 192 пингуются, а наоборот - нет.
Не могу разобраться как пакеты гуляют.
Код: Выделить всё
/ip firewall address-list
add address=172.16.0.0/16 list=LAN
add address=192.168.0.0/16 list=LAN
/ip firewall filter
add chain=input protocol=icmp
add chain=input connection-state=established in-interface=ETH05_WAN
add chain=input connection-state=related in-interface=ETH05_WAN
add chain=input src-address-list=LAN
add chain=forward in-interface=TEST_VPN
add action=jump chain=forward in-interface=ETH05_WAN jump-target=customer
add chain=customer connection-state=established
add chain=customer connection-state=related
add action=drop chain=customer
add action=drop chain=input in-interface=ETH05_WAN
/ip firewall nat
add action=masquerade chain=srcnat dst-address-list=!LAN src-address-list=LAN
/ip route
add distance=1 gateway=55.55.68.1
add distance=1 dst-address=192.168.5.0/24 gateway=TEST_VPN
Код: Выделить всё
/ip firewall address-list
add address=192.168.5.0/24 list=AL_NET_LOCAL
add address=192.168.10.0/24 list=AL_NET_LOCAL
add address=192.192.198.240/29 list=EXT_IP_LIST
add address=192.168.100.0/24 list=AL_NET_LOCAL
/ip firewall filter
add chain=input comment="Allow L2TP VPN" dst-port=1701 protocol=udp
add chain=input comment="Allow PPTP VPN" dst-port=1723 protocol=tcp
add chain=input comment="Allow PPTP VPN" protocol=gre
add chain=input comment=ICMP protocol=icmp
add chain=input comment=Established connection-state=established
add chain=input comment=Related connection-state=related
add chain=input comment="Local network" src-address-list=AL_NET_LOCAL
add chain=input comment="SIP address" src-address=193.194.169.1
add action=drop chain=input comment="!!! All other drop" in-interface=vlan720_ether5
add chain=forward comment=Established connection-state=established
add chain=forward comment=Related connection-state=related
add chain=forward dst-port=3389 protocol=tcp
add chain=forward dst-port=443,993 protocol=tcp
add chain=forward dst-port=25,465 protocol=tcp
add chain=forward connection-state=established dst-port=1433 protocol=tcp
add chain=forward comment="SIP address" src-address=193.194.169.1
add chain=forward comment=sip.m212.ru src-address=193.210.30.2
add chain=forward src-address-list=AL_NET_LOCAL
add chain=forward dst-address=192.168.5.25
add action=log chain=forward comment="Drop invalid connection packets" connection-state=invalid
add action=log chain=forward comment="!!! All other drop"
/ip firewall nat
add action=src-nat chain=srcnat src-address-list=AL_NET_LOCAL to-addresses=192.192.198.244
/ip route
add distance=1 gateway=192.192.198.241
add distance=1 dst-address=172.16.16.0/24 gateway=<l2tp-TEST_VPN> pref-src=192.168.100.2
/ppp secret
add local-address=192.168.100.2 name=TEST_VPN password=password profile=Profile-L2TP remote-address=192.168.100.20 service=l2tp