Hello everyone,
I am fairly new to RouterOS and i would like to ask for some advice. I have setup a VPN using L2TP but unfortunately i cannot figure out why i cannot ping the LAN devices. I get connection timeout all the time. Here is my configuration…
# dec/29/2014 02:06:35 by RouterOS 6.23
# software id = VJU8-A9NU
#
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=3des,aes-256-cbc pfs-group=none
/ip pool
add name=dhcp_pool1 ranges=192.168.1.11-192.168.1.30
add name=dhcp_pool2 ranges=192.168.1.6-192.168.1.30
add name=home-vpn-pool1 ranges=10.0.1.1-10.0.1.10
/ip address
add address=192.168.1.1/24 interface=bridge1 network=192.168.1.0
add address=192.168.0.2/28 interface=ether1 network=192.168.0.0
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool1 always-broadcast=yes disabled=no \
interface=bridge1 lease-time=1d name=dhcp1
/ip dhcp-server lease
add address=192.168.1.4 mac-address=00:25:00:9F:ED:88 server=dhcp1
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.1 gateway=192.168.1.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip firewall filter
add chain=icmp comment="echo reply" icmp-options=0:0 protocol=icmp
add chain=icmp comment="net unreachable" icmp-options=3:0 protocol=icmp
add chain=icmp comment="host unreachable" icmp-options=3:1 protocol=icmp
add chain=icmp comment="allow source quench" icmp-options=4:0 protocol=icmp
add chain=icmp comment="allow echo request" icmp-options=8:0 protocol=icmp
add chain=icmp comment="allow time exceed" icmp-options=11:0 protocol=icmp
add chain=icmp comment="allow parameter bad" icmp-options=12:0 protocol=icmp
add action=log chain=input comment="Allow L2TP connections" in-interface=\
ether1
add chain=input connection-state=new dst-port=500 in-interface=ether1 \
protocol=udp
add chain=input connection-state=new dst-port=4500 in-interface=ether1 \
protocol=udp
add chain=input connection-state=new dst-port=1701 in-interface=ether1 \
protocol=udp
add chain=input comment="Allow Winbox from WAN" dst-port=8291 in-interface=\
ether1 log=yes protocol=tcp
add chain=services comment="accept localhost" dst-address=127.0.0.1 \
src-address=127.0.0.1
add chain=input dst-address=192.168.1.1 dst-port=80 protocol=tcp src-port=80
add chain=services comment="allow IPSec" protocol=ipsec-esp
add chain=services comment="allow IPSec" protocol=ipsec-ah
add chain=services comment="allow DHCP" disabled=yes dst-port=67-68 protocol=\
udp
add action=drop chain=icmp comment="deny all other types"
add action=drop chain=forward comment="Drop Traceroute" icmp-options=11:0 \
protocol=icmp
add action=drop chain=forward icmp-options=3:3 protocol=icmp
add action=drop chain=forward comment="Disable ICMP ping" protocol=icmp
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="Port scanners to list" \
protocol=tcp psd=21,3s,3,1
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="NMAP FIN Stealth scan" \
protocol=tcp tcp-flags=fin,!syn,!rst,!psh,!ack,!urg
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="SYN/FIN scan" protocol=tcp \
tcp-flags=fin,syn
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="SYN/RST scan" protocol=tcp \
tcp-flags=syn,rst
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="FIN/PSH/URG scan" protocol=\
tcp tcp-flags=fin,psh,urg,!syn,!rst,!ack
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="ALL/ALL scan" protocol=tcp \
tcp-flags=fin,syn,rst,psh,ack,urg
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="NMAP NULL scan" protocol=tcp \
tcp-flags=!fin,!syn,!rst,!psh,!ack,!urg
add action=drop chain=input comment="dropping port scanners" \
src-address-list="port scanners"
add action=drop chain=forward comment="dropping port scanners" \
src-address-list="port scanners"
add action=drop chain=input comment="Drop Invalid connections" \
connection-state=invalid
add chain=input comment="Allow Established connections" connection-state=\
established
add chain=input in-interface=pppoe-out1 src-address=192.168.1.0/24
add action=drop chain=forward comment="drop invalid connections" \
connection-state=invalid
add chain=forward comment="allow already established connections" \
connection-state=established
add chain=forward comment="allow related connections" connection-state=\
related
add action=drop chain=forward src-address=127.0.0.0/8
add action=drop chain=forward dst-address=127.0.0.0/8
add action=drop chain=forward src-address=169.254.0.0/16
add action=drop chain=forward dst-address=169.254.0.0/16
add action=drop chain=forward src-address=172.16.0.0/12
add action=drop chain=forward dst-address=172.16.0.0/12
add action=drop chain=forward src-address=192.0.0.0/24
add action=drop chain=forward dst-address=192.0.0.0/24
add action=drop chain=forward src-address=192.0.2.0/24
add action=drop chain=forward dst-address=192.0.2.0/24
add action=drop chain=forward src-address=198.18.0.0/15
add action=drop chain=forward dst-address=198.18.0.0/15
add action=drop chain=forward src-address=198.51.100.0/24
add action=drop chain=forward dst-address=198.51.100.0/24
add action=drop chain=forward src-address=203.0.113.0/24
add action=drop chain=forward dst-address=203.0.113.0/24
add action=drop chain=forward src-address=224.0.0.0/3
add action=drop chain=forward dst-address=224.0.0.0/3
add action=jump chain=forward comment="Make jumps to new chains" jump-target=\
tcp protocol=tcp
add action=jump chain=forward jump-target=udp protocol=udp
add action=jump chain=forward jump-target=icmp protocol=icmp
add action=drop chain=tcp comment="deny TFTP" dst-port=69 protocol=tcp
add action=drop chain=tcp comment="deny RPC portmapper" dst-port=111 \
protocol=tcp
add action=drop chain=tcp comment="deny RPC portmapper" dst-port=135 \
protocol=tcp
add action=drop chain=tcp comment="deny NBT" dst-port=137-139 protocol=tcp
add action=drop chain=tcp comment="deny cifs" dst-port=445 protocol=tcp
add action=drop chain=tcp comment="deny NFS" dst-port=2049 protocol=tcp
add action=drop chain=tcp comment="deny NetBus" dst-port=12345-12346 \
protocol=tcp
add action=drop chain=tcp comment="deny NetBus" dst-port=20034 protocol=tcp
add action=drop chain=tcp comment="deny BackOriffice" dst-port=3133 \
protocol=tcp
add action=drop chain=udp comment="deny TFTP" dst-port=69 protocol=udp
add action=drop chain=udp comment="deny PRC portmapper" dst-port=111 \
protocol=udp
add action=drop chain=udp comment="deny PRC portmapper" dst-port=135 \
protocol=udp
add action=drop chain=udp comment="deny NBT" dst-port=137-139 protocol=udp
add action=drop chain=udp comment="deny NFS" dst-port=2049 protocol=udp
add action=drop chain=udp comment="deny BackOriffice" dst-port=3133 protocol=\
udp
add chain=services comment="allow MACwinbox " disabled=yes dst-port=20561 \
protocol=udp
add chain=services comment="Bandwidth server" dst-port=2000 protocol=tcp
add chain=services comment=" MT Discovery Protocol" dst-port=5678 protocol=\
udp
add chain=services comment="allow SNMP" dst-port=161 protocol=tcp
add chain=services comment="Allow BGP" disabled=yes dst-port=179 protocol=tcp
add chain=services comment="allow BGP" disabled=yes dst-port=5000-5100 \
protocol=udp
add chain=services comment="Allow NTP" disabled=yes dst-port=123 protocol=udp
add chain=services comment="Allow PPTP" disabled=yes dst-port=1723 protocol=\
tcp
add chain=services comment="allow PPTP and EoIP" disabled=yes protocol=gre
add chain=services comment="allow DNS request" dst-port=53 protocol=tcp
add chain=services comment="Allow DNS request" dst-port=53 protocol=udp
add chain=services comment=UPnP disabled=yes dst-port=1900 protocol=udp
add chain=services comment=UPnP disabled=yes dst-port=2828 protocol=tcp
add chain=services comment="allow Web Proxy" disabled=yes dst-port=8080 \
protocol=tcp
add chain=services comment="allow IPIP" disabled=yes protocol=ipencap
add chain=services comment="allow https for Hotspot" disabled=yes dst-port=\
443 protocol=tcp
add chain=services comment="allow Socks for Hotspot" disabled=yes dst-port=\
1080 protocol=tcp
add chain=services comment="allow IPSec connections" disabled=yes dst-port=\
500 protocol=udp
add chain=services comment="allow RIP" disabled=yes dst-port=520-521 \
protocol=udp
add chain=services comment="allow OSPF" disabled=yes protocol=ospf
/ip firewall mangle
add action=mark-packet chain=postrouting comment=\
"Link-critical traffic (DHCP)" dst-port=67 new-packet-mark=link_critical \
out-interface=bridge1 passthrough=no protocol=udp src-port=68
add action=mark-packet chain=postrouting comment=\
"IPSec VPN (same priority as link critical)" new-packet-mark=\
link_critical out-interface=bridge1 passthrough=no protocol=ipsec-esp
add action=mark-packet chain=postrouting comment="Time-critical traffic (DNS, \
TCP control packets, certain ACK packets, new connections)" dst-port=53 \
new-packet-mark=time_critical out-interface=bridge1 passthrough=no \
protocol=udp
add action=mark-packet chain=postrouting new-packet-mark=time_critical \
out-interface=bridge1 passthrough=no protocol=tcp tcp-flags=fin,syn,rst
add action=mark-packet chain=postrouting new-packet-mark=time_critical \
out-interface=bridge1 packet-size=40-89 passthrough=no protocol=tcp \
tcp-flags=ack
add action=mark-packet chain=postrouting connection-state=new \
new-packet-mark=time_critical out-interface=bridge1 passthrough=no \
protocol=tcp
add action=mark-packet chain=postrouting comment=\
"Critical traffic (just some ACK packets)" new-packet-mark=critical \
out-interface=bridge1 packet-size=90-159 passthrough=no protocol=tcp \
tcp-flags=ack
add action=mark-packet chain=postrouting comment=\
"High-priority interactive traffic (SSH, WinBox, certain ACK packets)" \
new-packet-mark=high_pri_interactive out-interface=bridge1 passthrough=no \
port=22,2200 protocol=tcp
add action=mark-packet chain=postrouting new-packet-mark=high_pri_interactive \
out-interface=ether1 passthrough=no port=8291 protocol=tcp
add action=mark-packet chain=postrouting new-packet-mark=high_pri_interactive \
out-interface=ether1 packet-size=160-249 passthrough=no protocol=tcp \
tcp-flags=ack
add action=mark-packet chain=postrouting comment=\
"Low-priority interactive traffic (HTTP, HTTPS)" new-packet-mark=\
low_pri_interactive out-interface=bridge1 passthrough=no port=80,443,8112 \
protocol=tcp
add action=mark-packet chain=postrouting new-packet-mark=low_pri_interactive \
out-interface=bridge1 packet-size=250-359 passthrough=no protocol=tcp \
tcp-flags=ack
add action=mark-packet chain=postrouting comment=\
"Low-priority non-interactive traffic (POP, SMTP)" new-packet-mark=\
low_pri_non_interactive out-interface=bridge1 passthrough=no port=25,110 \
protocol=tcp
add action=mark-packet chain=postrouting new-packet-mark=\
low_pri_non_interactive out-interface=bridge1 packet-size=490-639 \
passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting comment="Non-critical traffic (P2P)" \
new-packet-mark=non_critical out-interface=bridge1 packet-size=640-809 \
passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting new-packet-mark=non_critical \
out-interface=bridge1 passthrough=no protocol=tcp
/ip firewall nat
add action=masquerade chain=srcnat src-address=192.168.1.0/24
add action=masquerade chain=srcnat src-address=10.0.1.0/24
/ip ipsec peer
add enc-algorithm=3des exchange-mode=main-l2tp generate-policy=port-strict \
secret=x
Thank you in advance