Hi guys
*sorry if this not a mikrotik only problem but this is a post after a week of nothing done
I try to run a Ubuntu server as wireguard vpn server and get access to this VPN server via my local network on mikrotik router.
The wireguard IP range is 10.9.0.0/24
And the local network on my mikrotik is : 10.8.0.0/24
I want the local network have a gateway with wireguard only and use the Ubuntu server internet .
But : I try to config this but the more I try the less this happen .
What I do : is the wireguard tunnel is connected and both side can ping each other .
Ubuntu server can Ping my local network IP like 10.8.0.10 (a device in mikrotik network)
But when I try to traceroute the internet the last hop that can be seen by Mikrotik Local network is 10.8.0.1 and not reach after this.
#--------------------------
Ubuntu Configs :
root@ubuntu ~ # ip addr
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 90:1b:0e:ab:a6:d9 brd ff:ff:ff:ff:ff:ff
inet 99.99.99.99/32 scope global enp0s31f6
19: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 10.9.0.1/24 scope global wg0
Iptables :
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE
Wireguard Config on Ubuntu :
[Interface]
Address = 10.9.0.1/24
SaveConfig = true
ListenPort = 9000
PrivateKey = xxxxxxxxxxxxxxxxxxxxx
[Peer]
PublicKey = yyyyyyyyyyyyyyyyyyyy
PresharedKey = zzzzzzzzzzzzzzzzzz
AllowedIPs = 10.9.0.0/24, 10.8.0.0/24
Endpoint = 88.88.88.88:9000 # My Mikrotik Public IP
PersistentKeepalive = 25
#--------------------------
Mikrotik Configs :
/interface wireguard
add listen-port=9000 mtu=1420 name=wireguard
/interface wireguard peers
add allowed-address=10.9.0.0/24,10.8.0.0/24 endpoint-address=99.99.99.99 \
endpoint-port=9000 interface=wireguard persistent-keepalive=25s \
public-key="ffffffffffffffffffffff"
/ip address
add address=10.9.0.2/24 interface=wireguard network=10.9.0.0
add address=10.8.0.1/24 interface=ether2 network=10.8.0.0
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wireguard \
routing-table=wg scope=30 suppress-hw-offload=no target-scope=10
/routing rule
add action=lookup disabled=no src-address=10.8.0.0/24 table=wg