Answer the question
In order to leave comments, you need to log in
How to forward ports in Mikrotik from PPTP interface via 3G modem?
In a country house there is a Mikrotik router with an LTE modem connected, which is defined as the "lte1" interface, a DHCP client is configured for lte1, it receives an IP address from the modem 192.168.0.101, gateway: 192.168.0.1 (modem address).
To access the Internet from the local network 192.168.1.0-255, a masquerade has been added:
2;;; LTE Modem
chain=srcnat action=masquerade out-interface=lte1
# ADDRESS NETWORK INTERFACE
0 ;;; default configuration
192.168.1.1/24 192.168.1.0 ether2-master-local
1 D 192.168.0.101/24 192.168.0.0 lte1
2 D 8.8.8.96/32 8.8.8.10 pptp-out1
3 chain=dstnat action=dst-nat to-addresses=192.168.1.2 to-ports=80 protocol=tcp in-interface=pptp-out1 dst-port=8080
3 chain=dstnat action=dst-nat to-addresses=192.168.1.2 to-ports=80
protocol=tcp dst-address=8.8.8.96 dst-port=8080
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS 0.0.0.0/0 192.168.0.1 0
1 ADC 8.8.8.10/32 8.8.8.96 pptp-out1 0
2 ADC 192.168.0.0/24 192.168.0.101 lte1 0
3.16.192 1.0/24 192.168.1.1 bridge-local 0
Flags: X - disabled, I - invalid, D - dynamic
0 ;;; default configuration
chain=input action=accept protocol=icmp
1 ;;; default configuration
chain=input action=accept connection-state=established
2 ;;; default configuration
chain=input action=accept connection-state=related
3 X ;;; default configuration
chain=input action=drop in-interface=ether1-gateway
4 X ;;; default configuration
chain=input action=drop in-interface=sfp1-gateway
5 ;;; default configuration
chain=forward action=accept connection-state=established
6 ;;; default configuration
chain=forward action=accept connection-state=related
7 X ;;; default configuration
chain=forward action=drop connection-state=invalid
Answer the question
In order to leave comments, you need to log in
3 chain=dstnat action=dst-nat to-addresses=192.168.1.2 to-ports=80 protocol=tcp in-interface=pptp-out1 dst-port=8080
but besides that add another masquerade for packets outgoing through pptp-out1
you should have two masquerade
chain=srcnat action=masquerade out-interface=lte1
chain=srcnat action=masquerade out-interface=pptp-out1
if on fingers. Here dstnat worked, the packet went to the internal address. And the answer? That's right, it will take off through the summer. And you are waiting for it on the vpn interface..
You can also make it a little easier, create one rule - chain=srcnat action=masquerade , without specifying an interface. And then NAT will be on both.
Uniting and conquering
Total:
You need to add two rules (or change one, which is not very good) in NAT:
1.chain=dstnat action=dst-nat to-addresses=192.168.1.2 to-ports=80 protocol=tcp in- interface=pptp-out1 dst-port=8080
2.chain=srcnat action=masquerade out-interface=pptp-out1
You also need (optional in your case) to add an allow rule in the filter:
And last but not least, routes. In your case, you need to make sure that all traffic coming from the VPN goes to it, now the routes will send it to lte (as they say "mask don't mask you still get ..."), to fix this, you need to see this picture in the routes :
0 ADS 0.0.0.0/0 8.8.8.96 pptp-out1 0
1 ADS %
ADDR_VPN_SERVER % 192.168.0.1 0
traffic to the VPN server goes through LTE, and everything else goes through the VPN tunnel. If your situation is more tricky, and you need only a certain type of traffic to work through the tunnel, then you need to mark connections, mark routes and route tables (although maybe I'm complicating it and colleagues know the way better).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question