How to Redirect Internet Traffic from Router A to Router B via Mikrotik VPN

To redirect internet traffic from Router A to Router B using a MikroTik VPN, you'll need to configure routing and VPN settings on your MikroTik device. Here's a general outline:

1. Set Up the VPN:

  • Configure the VPN client on your MikroTik router to connect to Router B. This could be an L2TP, PPTP, or WireGuard VPN, depending on your setup.

  • Ensure the VPN connection is active and has a valid IP address.

2. Define Routing Rules:

  • Add a route in the MikroTik router to direct traffic destined for the internet through the VPN interface.
  • Use the IP > Routes menu in the MikroTik interface or the command line to set the gateway as the VPN interface.

3. Mark Traffic (Optional):

  • If you want to redirect only specific traffic, use IP > Firewall > Mangle to mark packets based on criteria like source IP, destination IP, or protocol.

4. NAT Configuration:

  • Set up NAT (Network Address Translation) on the VPN interface to ensure that traffic is properly translated when it exits through Router B.

5. Test the Configuration:

  • Verify that traffic from Router A is being routed through Router B by checking the MikroTik logs or using tools like traceroute.

# Router A (MyRepublic) /interface bridge add name=bridge-local /ip address add address=192.168.77.1/24 interface=bridge-local add address=192.168.1.2/24 interface=ether1 /ip route add dst-address=192.168.88.0/24 gateway=103.134.11.1 /ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade # Router B (IndiHome) /interface bridge add name=bridge-local /ip address add address=192.168.88.1/24 interface=bridge-local add address=192.168.2.2/24 interface=ether1 /ip route add dst-address=0.0.0.0/0 gateway=103.134.11.1 /ip firewall nat add chain=srcnat out-interface=103.134.11.1 action=masquerade

Brief explanation:
- Router A routes traffic to Router B local network (192.168.88.0/24) via VPN (103.134.11.1).
- Router B routes all internet traffic (0.0.0.0/0) to Router A via VPN (103.134.11.1), so that the internet on Router B comes from MyRepublic (Router A).
Scroll to top
Code Copied!