Dear all,
I’m having difficulties with WireGuard. I have a setup that work, when the WAN IP is set on private IP and routed to a modem/ONT.
If the WAN is a static public IP, my WireGuard setup is unable to connect, it failed handshake. the TX value is rising, but RX value on Wireguard is 0.
Can someone please help me. Here is my setup.
# model = RB5009UG+S+
/interface bridge
add admin-mac=DC:2C:6E:31:28:E1 auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether8 ] name="ether8 - CBN 250MB"
set [ find default-name=sfp-sfpplus1 ] advertise="10M-half,10M-full,100M-half,\
100M-full,1000M-half,1000M-full,10000M-full,2500M-full,5000M-full"
/interface l2tp-client
add connect-to=tsno.access.ly disabled=no name="Amazon EC2" user=KPM-HQ
/interface wireguard
add listen-port=13231 mtu=1280 name=WG-SurfShark
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=192.168.38.1-192.168.38.200
/ip dhcp-server
add address-pool=default-dhcp interface=bridge lease-time=3d name=defconf
/ppp profile
add change-tcp-mss=yes local-address=192.168.201.250 name="L2TP Dial In" \
only-one=yes use-encryption=no
/queue type
add kind=pcq name="PCQ - Download - 100M" pcq-classifier=dst-address \
pcq-rate=100M
add kind=pcq name="PCQ - Download 50M" pcq-classifier=dst-address pcq-rate=\
50M
add kind=pcq name="PCQ - Upload - 80M" pcq-classifier=src-address pcq-rate=\
80M
add kind=pcq name="PCQ - Upload - 30M" pcq-classifier=src-address pcq-rate=\
30M
/queue tree
add max-limit=250M name="Global Download - 250M" parent=global queue=\
pcq-download-default
add max-limit=250M name="Upload Global - 250M" parent=global queue=\
pcq-upload-default
add max-limit=200M name="Download - Internal" packet-mark="Download - LAN" \
parent="Global Download - 250M" priority=6 queue="PCQ - Download 50M"
add max-limit=200M name="Upload - Internal" packet-mark="Upload - LAN" \
parent="Upload Global - 250M" priority=6 queue="PCQ - Upload - 30M"
/routing table
add disabled=no fib name=WG1-SurfShark
/interface bridge port
add bridge=bridge comment=defconf ingress-filtering=no interface=ether2
add bridge=bridge comment=defconf ingress-filtering=no interface=ether3
add bridge=bridge comment=defconf ingress-filtering=no interface=ether4
add bridge=bridge comment=defconf ingress-filtering=no interface=ether5
add bridge=bridge comment=defconf ingress-filtering=no interface=ether6
add bridge=bridge comment=defconf ingress-filtering=no interface=ether7
add bridge=bridge comment=defconf ingress-filtering=no interface=sfp-sfpplus1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set max-neighbor-entries=8192
/interface l2tp-server server
set enabled=yes use-ipsec=required
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface="ether8 - CBN 250MB" list=WAN
add interface=WG-SurfShark list=LAN
/interface ovpn-server server
set auth=sha1,md5
/interface wireguard peers
add allowed-address=0.0.0.0/0 endpoint-address=id-jak.prod.surfshark.com \
endpoint-port=51280 interface=WG-SurfShark persistent-keepalive=25s \
public-key="qyghLDfpfyparp0M52OVcmhKckayOvbRO2DDLkgJqyk="
/ip address
add address=192.168.38.250/24 comment=defconf interface=bridge network=\
192.168.38.0
add address=103.113.xx.xx/30 interface="ether8 - CBN 250MB" network=\
103.113.xx.xx
add address=10.14.0.2/16 interface=WG-SurfShark network=10.14.0.0
/ip dhcp-client
add interface="ether8 - CBN 250MB"
/ip dhcp-server network
add address=192.168.38.0/24 comment=defconf dns-server=192.168.38.250 \
gateway=192.168.38.250
/ip firewall address-list
add address=192.168.38.0/24 list="All IP"
add address=10.0.0.0/24 list="All IP"
add address=192.168.38.1-192.168.38.249 list="All Client IP"
add address=192.168.38.251-192.168.38.254 list="All Client IP"
add address=192.168.201.99 list="Internet VPN"
add address=192.168.201.1 list="Internet VPN"
add address=192.168.201.0/24 list="All IP"
add address=192.168.87.0/24 list="All IP"
add address=192.168.199.0/24 list="All IP"
add address=192.168.99.0/24 list="All IP"
/ip firewall mangle
add action=change-mss chain=forward new-mss=1200 out-interface=WG-SurfShark \
passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1201-65535
add action=mark-routing chain=prerouting disabled=yes dst-address-list=\
"!All IP" in-interface=bridge new-routing-mark=WG1-SurfShark passthrough=\
yes src-address=192.168.38.1
add action=mark-packet chain=forward dst-address-list="!All IP" in-interface=\
bridge new-packet-mark="Upload - LAN" passthrough=yes protocol=!icmp \
src-address-list="All Client IP"
add action=mark-packet chain=forward dst-address-list="All Client IP" \
new-packet-mark="Download - LAN" out-interface=bridge passthrough=yes \
protocol=!icmp src-address-list="!All IP"
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
src-address-list="All IP"
add action=dst-nat chain=dstnat comment="NAS Redirect" dst-address=\
103.113.xx.xx src-address-list="All Client IP" to-addresses=192.168.38.1
add action=dst-nat chain=dstnat comment=NAS dst-port=443 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=443
add action=dst-nat chain=dstnat comment=NAS dst-port=8080 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=8080
add action=dst-nat chain=dstnat comment=NAS dst-port=9000 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=9000
add action=dst-nat chain=dstnat comment=NAS dst-port=8081 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=139
add action=dst-nat chain=dstnat comment=NAS dst-port=548 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=548
add action=dst-nat chain=dstnat comment=NAS dst-port=139 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=139
add action=dst-nat chain=dstnat comment=NAS dst-port=445 in-interface=\
"ether8 - CBN 250MB" protocol=tcp to-addresses=192.168.38.1 to-ports=445
add action=dst-nat chain=dstnat comment=NAS disabled=yes dst-port=137 \
in-interface="ether8 - CBN 250MB" protocol=udp to-addresses=192.168.38.1 \
to-ports=137
add action=dst-nat chain=dstnat comment=NAS disabled=yes dst-port=138 \
in-interface="ether8 - CBN 250MB" protocol=udp to-addresses=192.168.38.1 \
to-ports=138
add action=dst-nat chain=dstnat comment=NAS disabled=yes dst-port=139 \
in-interface="ether8 - CBN 250MB" protocol=udp to-addresses=192.168.38.1 \
to-ports=139
add action=dst-nat chain=dstnat comment=NAS dst-port=445 in-interface=\
"ether8 - CBN 250MB" protocol=udp to-addresses=192.168.38.1 to-ports=445
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip proxy
set port=8083
/ip route
add disabled=no distance=3 dst-address=0.0.0.0/0 gateway=103.113.xx.xx \
routing-table=main suppress-hw-offload=no
add check-gateway=ping disabled=no distance=1 dst-address=192.168.199.1/32 \
gateway=192.168.199.250 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no dst-address=192.168.87.0/24 gateway=\
192.168.201.2 routing-table=main suppress-hw-offload=no
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
WG-SurfShark pref-src="" routing-table=WG1-SurfShark scope=30 \
suppress-hw-offload=no target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www port=8383
set ssh disabled=yes
set api disabled=yes
set winbox port=833
set api-ssl disabled=yes
/system clock
set time-zone-name=Asia/Jakarta
/system routerboard settings
set cpu-frequency=1400MHz
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
I know I have not route any traffic from client IPs to the WireGuard.
I tried the WireGuard interface using ping tool, ping to 1.1.1.1 interface WG-Surfshark >>> it TIMED OUT. and the RX is 0… TX going up, but RX 0…
I will setup the route or WireGuard, after i can ping 1.1.1.1 from Ping Tool.