Fair enough, now what is on the other end of the L2TP connection,
a. you have a cloud server with public IP (which OS?)
b. a friends router with a public IP
c. ???
Problem is am unfamiliar with how L2TP works… Wireguard I understand more fully.
In any case for your scenario…
If you can identify the gateway IP of the L2TP interface then what you have done is close.
-
Remove the dstnat rules for now and keep the sourcenat rule.
/ip firewall nat
add action=masquerade chain=srcnat comment=“defconf: masquerade”
ipsec-policy=out,none out-interface-list=WAN
-
On the other site, still unknown, that is where the port forwarding is setup such that external users using the public IP can reach the server.
So the other ends router will need to be configured, its impossible to do it all from this MT router…
-
Confused as you have ether5 on the bridge but ALSO the below, and do not understand where that address came from and is used for???
/ip dhcp-relay
add dhcp-server=172.16.0.1 interface=ether5 name=relay1
-
Not sure why you put distance=5 on the default route connection for your WAN, not required. Since there is no other main table route its meaningless.
-
Lets fix IP routes.
The primary main route already exists from the ip dhcp client settings… no other IP routes for starlink are required and thus should remove the recursive stuff going on.
/ip dhcp-client
add default-route interface=ether1
So we need only be concerned with identifying the route for the special table.
add dst-address=0.0.0.0/0 gateway=l2TP gateway IP address routing-table=WEBCAM-OVER-VPN
Next as you done we simply use routing rules which will make use of the new route.
/routing rules
add min-prefix=0 action=lookup-only-in-table table=main comment=“ensures local traffic requirements met”
add src-address=192.168.9.1 action=lookup-only-in-table table=WEBCAM-OVER-VPN
This covers all traffic originating from 192.168.9.1. Any comms needed with other local interfaces will be allowed to occur such as you as admin wanting to access the device and the RETURN traffic from the device… All of its other traffic will be captured by the routing rule and will use the special table created..
Since we stated the L2TP was part of the WAN interface list, that means all traffic going out the L2TP interface will be sourcenatted to the MTs assigned LT2P ip address.
This should make the traffic appear correctly at the other side. You still have to ensure such traffic is allowed to access the local WAN on the other end of course.
++++++++++++++++++++++++++++++++++++++++
Now lets consider the incoming question. Imagine trying to have to deal with any possible www public IP reaching your CCTV server being port forwarded from the other end device into the L2TP tunnel. The easiest thing for us is for the remote site to also sourcnat all inquiries from the www those source addresses, to the single L2TP ip address of the Server at the other end, so all traffic will be recognized by the L2TP client settings on the MT router and will be able to reach the LAN server.
If that is not done, then imagine every possible IP address, not sure if allowed in LT2P , could possibly come over the L2TP tunnel hit CCTV and the problem is, where would the return traffic go. Well currently it would go out the local WAN and we dont want that.
In this situation we would HAVE TO mark and mangle the incoming traffic and then route it out back to the L2TP tunnel.
So in summary what is going on at the other end of this connection is critical.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++