Hi everyone, I have a Mikrotik Router with two ISPs working in the main Routing Table.
Inside the LAN I have a second routing table that sends out the X server with IP 192.168.10.2 with a remote Wireguard tunnel.
So basically the scenario is this:
/interface wireguard add listen-port=13231 name=wireguard1
/interface wireguard peers
add allowed-address=0.0.0.0/0 endpoint-address=6.7.8.9 endpoint-port=13231 persistent-keepalive=25s
/ip address
add address=1.2.3.4/32 network=100.64.12.23 interface=ether1 comment=ISP1
add address=5.6.7.8/32 network=100.64.1.49 interface=ether2 comment=ISP2
add address=192.168.10.1/24 network=192.168.10.0 interface=ether3 comment=LAN
add address=10.165.34.2/30 network=10.165.34.0 interface=wireguard1
/ip firewall nat
add chain=dstnat protocol=tcp dst-port=443 in-interface=wireguard1 action=dstnat to-address=192.168.10.2
add chain=srcnat src-address=192.168.10.0/24 out-interface=ether1 action=masquerade
add chain=srcnat src-address=192.168.10.0/24 out-interface=ether1 action=masquerade
add chain=srcnat src-address=192.168.10.2/32 out-interface=wireguard1 action=masquerade
/routing table add name=to_WG fib=yes
/ip firewall mangle
add chain=prerouting protocol=tcp dst-port=443 in-interface=ether1 action=mark-connection new-connection-mark=ISP1_conn
add chain=prerouting src-address=192.168.10.2 connection-mark=!ISP1_conn action=mark-routing new-routing-mark=to_WG
/ip route
add gateway=100.64.12.23 distance=1
add gateway=100.64.1.49 distance=2
add gateway=10.165.34.1 distance=1 routing-table=to_WG
currently from an external network you reach my server with public IP 6.7.8.9. I would also like to reach it from ip 1.2.3.4 at the same time. I did various tests by adding the second gateway in the to_WG routing table or leaving it on the main but I had no results.
Could anyone provide me with some useful information?