Tis true, I am attempting to setup up IKEv2, to primarily use the MT App and to further of course my knowledge of configuring RouterOS.
I have managed to create the necessary certificates on the MT and transfer them to my Iphone (thanks to python).
I believe I have configured the IPSEC portion successfully but I am now flailing somewhat moving forward.
Specifically, I am lost in terms of setting firewall rules. I could not find clear guidance anywhere at least that I understood. ![]()
I know that IKEv2 uses UDP port 500 for phase 1 and that is probably all I need in terms of port forwarding.
But to where?? My made up subnet pool for ipsec is 192.168.44.0/24
/add firewall nat
add action=dstnat chain=dst-nat in-interface-list=WAN dst-port=500 protocol=udp to address=???
I am also thinking that I will have to create a forward firewall rule from the vpn-pool, to the subnet I wish to gain access to through the vpn tunnel
/add firewall filter
add action=accept chain=forward in-interface=vpnsubnet out-interface=home-vlan11 (log=yes)
Reading tutorials, wikis, viewing videos, I get the sense that I also will ALSO have to create source nat rules and mangle traffic, but should it be that hard and complex???
There are potentially three scenarios
(1) Primary Purpose: Be able to use IOS app to gain access to winbox.
(2) Secondary Purpose: Be able to gain access to LAN shares (or even print on home printer)
(3) Tertiary Purpose: Be able to surf the internet but using the Router as my firewall.
I believe all three scenarios can be boiled down to simply accessing the home-lan (my home-vlan11).
Thus this is what I think I need help in to complete my config.
Abbreviated for clarity, please have a look to see if I have missed any ipsec type items…
For example, not sure but I think saw something that indicated perhaps the default ipsec policy forward chain rules should be BEFORE fastrack??
# mar/22/2019 09:07:31 by RouterOS 6.44
# model = RB450Gx4
/interface ethernet
set [ find default-name=ether5 ] comment=Port5 name=Bell_eth5 speed=100Mbps
set [ find default-name=ether1 ] comment=Port1 name=Eastlink_eth1 speed=\
100Mbps
set [ find default-name=ether4 ] comment=PI_DNS_RESOLVER name=eth4-PI (future work pi is on its way!!)
set [ find default-name=ether2 ] comment=LAN1-Home speed=100Mbps
set [ find default-name=ether3 ] comment=LAN1-Home speed=100Mbps
/interface bridge
add admin-mac= auto-mac=no comment=defconf name=HomeBridge \
vlan-filtering=yes
/interface vlan
add interface=HomeBridge name=Home-LAN_V11 vlan-id=11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip ipsec profile
add dh-group=modp2048 dpd-interval=1h enc-algorithm=aes-256,aes-128 \
hash-algorithm=sha256 name=ios-profile
/ip ipsec peer
add exchange-mode=ike2 name=ios-peer passive=yes profile=ios-profile \
send-initial-contact=no
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=ios-ikev2-proposal \
pfs-group=none
/ip pool
add name=pool-mobilevpn ranges=192.168.44.0/24
add name=dhcp-HomeLAN ranges=192.168.0.33-192.168.0.150
/ip dhcp-server
add address-pool=dhcp-HomeLAN disabled=no interface=Home-LAN_V11 lease-time=\
1d name=HoMeLAN
/ip ipsec mode-config
add address-pool=pool-mobilevpn name=cfg1 static-dns=8.8.8.8 system-dns=no
/interface bridge port
add bridge=HomeBridge comment=defconf ingress-filtering=yes interface=ether2
add bridge=HomeBridge comment=defconf ingress-filtering=yes interface=ether3
/ip settings
set allow-fast-path=no icmp-rate-limit=100 rp-filter=loose
/interface bridge vlan
add bridge=HomeBridge tagged=HomeBridge,ether2 vlan-ids=\
30,2,36,40,45,55,100,200,666
add bridge=HomeBridge tagged=HomeBridge,ether3 vlan-ids=99,77,33
add bridge=HomeBridge tagged=HomeBridge,ether2,ether3 vlan-ids=11
/ip address
add address=192.168.0.1/24 interface=Home-LAN_V11 network=192.168.0.0
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=192.168.0.1 gateway=192.168.0.1
/ip dns
set allow-remote-requests=yes servers=\
8.8.8.8,8.8.4.4,208.67.220.220,208.67.222.222,1.0.0.1
/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="Allow ADMIN to Router" \
in-interface-list=LAN src-address-list=adminaccess
add action=accept chain=input comment="Allow LAN DNS queries-UDP" \
connection-state="" dst-port=53 in-interface-list=LAN protocol=udp
add action=accept chain=input comment="Allow LAN DNS queries - TCP" dst-port=\
53 in-interface-list=LAN protocol=tcp
add action=drop chain=input comment="DROP ALL ELSE" log-prefix=\
"INPUT DROP ALL"
{forward chain}
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=drop chain=forward comment="Drop external DNS - UDP" \
dst-port=53 in-interface-list=WAN protocol=udp
add action=drop chain=forward comment="Drop external DNS - TCP" \
dst-port=53 in-interface-list=WAN protocol=tcp
add action=accept chain=forward comment=\
"defconf: accept established,related, " connection-state=\
established,related
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=accept chain=forward comment="ENABLE HomeLAN to WAN" \
in-interface=HomeBridge log-prefix="ALLOWED LAN 2 WAN TRAFFIC" \
out-interface-list=WAN src-address=192.168.0.0/24
add action=accept chain=forward comment="allow VLANS to WAN " \
in-interface-list=VLANSwInt out-interface-list=WAN
add action=accept chain=forward comment=\
"Allow Port Forwarding - DSTNAT" connection-nat-state=dstnat \
connection-state=new in-interface-list=WAN
add action=drop chain=forward comment=\
"DROP ALL other FORWARD traffic" log-prefix="FORWARD DROP ALL"
/ip firewall nat
add action=masquerade chain=srcnat comment="SCR_NAT for LAN - Cable" \
ipsec-policy=out,none out-interface=Eastlink_eth1
add action=masquerade chain=srcnat comment="SCR_NAT FOR LAN - FibreOP" \
out-interface=vlanbell
/ip ipsec identity
add auth-method=rsa-signature certificate=vpnRM.server generate-policy=\
port-strict match-by=certificate mode-config=cfg1 my-id=fqdn:vpnRM.server \
peer=ios-peer remote-certificate=RMi6svpn.client remote-id=\
fqdn:RMi6svpn.client
/ip route
add check-gateway=ping distance=3 gateway=8.8.4.4
add check-gateway=ping distance=4 gateway=208.67.220.220
add distance=10 gateway=ISP2gatewayIP
add distance=3 dst-address=8.8.4.4/32 gateway=ISP1gatewayIP scope=10
add comment=Email_bypass distance=1 dst-address=24.222.0.20/32 gateway=\
ISP2gatewayIP
add distance=4 dst-address=208.67.220.220/32 gateway=ISP1gatewayIP scope=10
/system logging
add topics=ipsec
/system ntp client
set enabled=yes server-dns-names=time.nrc.ca,nrc.chu.ca
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=RBwin