L2TP with RADIUS
Posted: Wed Apr 10, 2019 10:52 am
Hi!
What I'm trying to achive:
- VPN acces to local network (L2TP, IPSec)
- authentication by Active Directory accounts
What have I done so far:
- Create RADIUS Server on Windows Server 2019
- it is possible to connect via 'standard' MikroTik account
What is not working:
- No acces to local network (from device connected via VPN)
- No access to internet (from device connected via VPN)
- RADIUS is not working properly (I've recive message 'The remote connection aws dnieded, because the user name and pasword combination you provided is not recognized, or the selected authentication protocol is not permitted on the remote access server")
I was using some tutorials, but in every tutorial I've got different advices. I'm not a network-guy, just developer, who have to configure simple company network.
Here is configuration, I would really appreciate Your help fixing and setting it up.
AD/DNS Server: 192.168.7.70
Router IP: 192.168.7.1
What I'm trying to achive:
- VPN acces to local network (L2TP, IPSec)
- authentication by Active Directory accounts
What have I done so far:
- Create RADIUS Server on Windows Server 2019
- it is possible to connect via 'standard' MikroTik account
What is not working:
- No acces to local network (from device connected via VPN)
- No access to internet (from device connected via VPN)
- RADIUS is not working properly (I've recive message 'The remote connection aws dnieded, because the user name and pasword combination you provided is not recognized, or the selected authentication protocol is not permitted on the remote access server")
I was using some tutorials, but in every tutorial I've got different advices. I'm not a network-guy, just developer, who have to configure simple company network.
Here is configuration, I would really appreciate Your help fixing and setting it up.
AD/DNS Server: 192.168.7.70
Router IP: 192.168.7.1
Code: Select all
/interface bridge
add admin-mac=74:4D:28:24:69:0B auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] arp=proxy-arp
set [ find default-name=ether3 ] arp=proxy-arp
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 \
password=*** use-peer-dns=yes user=***
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=4 band=2ghz-b/g/n channel-width=\
20/40mhz-XX country=poland disabled=no distance=indoors frequency=2447 \
frequency-mode=regulatory-domain mode=ap-bridge ssid=*** \
wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=\
dynamic-keys supplicant-identity=MikroTik wpa-pre-shared-key=\
*** wpa2-pre-shared-key=***
/ip ipsec profile
set [ find default=yes ] enc-algorithm=aes-256
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256,sha1 enc-algorithms=\
aes-256-cbc,aes-128-cbc pfs-group=none
/ip pool
add name=dhcp ranges=192.168.7.200-192.168.7.254
add name=VPN ranges=192.168.7.150-192.168.7.199
add name=VMs ranges=192.168.7.100-192.168.7.149
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/ppp profile
add dns-server=192.168.7.70 local-address=192.168.7.150 name=Vpn-clients \
remote-address=VPN
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=ether10
add bridge=bridge comment=defconf interface=sfp1
add bridge=bridge comment=defconf interface=wlan1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set authentication=mschap2 default-profile=Vpn-clients enabled=yes \
ipsec-secret=test use-ipsec=required
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN
/ip address
add address=192.168.7.1/24 comment=defconf interface=ether2 network=\
192.168.7.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid interface=ether1
/ip dhcp-server network
add address=192.168.7.0/24 comment=defconf gateway=192.168.7.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.7.1 name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=input dst-port=4500 protocol=udp
add action=accept chain=input dst-port=500 protocol=udp
add action=accept chain=input dst-port=1701 protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface=pppoe-out1 out-interface-list=WAN
/ip ssh
set allow-none-crypto=yes
/ppp aaa
set use-radius=yes
/ppp secret
add local-address=192.168.7.149 name=test password=test profile=\
default-encryption remote-address=192.168.7.151
/radius
add address=192.168.7.70 called-id=192.168.7.70 domain=agilerolocal.pl \
secret=AgileroSecret123 service=ppp src-address=192.168.7.1
/system clock
set time-zone-name=Europe/Warsaw
/system logging
add topics=firewall
add topics=debug
add topics=l2tp
add topics=ipsec
add topics=l2tp
add topics=radius
add topics=ipsec,!packet
add topics=!pppoe
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN