Hi guys,
Today as a first attempt i set up a simple vpn using these commands:
- Enable L2TP server,
Code: Select all
/interface l2tp-server server
set authentication=mschap2 enabled=yes - Configure PPP profile,
Code: Select all
/ppp profile
add change-tcp-mss=yes local-address=10.10.99.1 name=ipsec+L2TP remote-address=P-VPN use-encryption=yes
Code: Select all
/ip pool
add name=ipsec-pool ranges=10.10.99.11-10.10.99.20 - Create PPP secret,
Code: Select all
/ppp secret
add name=test password=“test” profile=ipsec+L2TP service=l2tp - Add static PPP interface to manage firewall easily.
Code: Select all
/interface l2tp-server add name=vpn user=test
Create IPSec configuration:
- setup
Code: Select all
/ip ipsec policy group
add name=ipsec+l2tp
Code: Select all
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=aes-256-cbc,aes-128-cbc,3des
Code: Select all
/ip ipsec peer
add address=0.0.0.0/0 enc-algorithm=aes-256,aes-192,aes-128 generate-policy=
port-strict secret=MikroTiKRouterOS
Code: Select all
/ip ipsec policy
add dst-address=0.0.0.0/0 protocol=udp src-address=0.0.0.0/0 template=yes
Which works great, i can connect to my network and i get an ip from the pool. My problem is when i m looking to ipconfig command, my subnet mask is 255.255.255, and the default gateway is 0.0.0.0 , hence i dont have internet connection. (i set up src nat correctly)
the public ip of the vpn is 193.XXX.XXX.174, which is cofigured on the same mikrotik router, which is the gateway to the internet for the local networks on ip 193.xxx.xxx.161, and the default route for this router points to 193.xxx.xxx.141
ip routes output is this :
DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 193.xxx.xxx.141 1
1 ADC 10.0.100.0/24 10.0.100.1 vlan100 0
2 ADC 192.168.0.0/24 192.168.0.1 vlan0 0
3 ADC 192.168.3.0/24 192.168.3.1 vlan3 0
4 ADC 192.168.4.0/24 192.168.4.1 vlan4 0
5 ADC 192.168.5.0/24 192.168.5.1 vlan5 0
6 DC 192.168.9.0/24 192.168.9.1 ether10 255
7 DC 192.168.88.0/24 192.168.88.1 ether1 255
8 ADC 193.xxx.xxx.128/26 193.xxx.xxx.161 ether12 0
I did not set up a physical interface for 10.10.99.1 nor did i set up route for network 10.10.99.0/24
Could somebody help me out to get internet acces through 193.xxx.xxx.161, if i connect to my vpn server ?
With regards,
Steve