Mikrotik - two links, no access to the router using the IP address.
Posted: Wed Jan 25, 2023 3:03 pm
Hi
I am trying to configure a Mikrotik router as follows:
- I have Internet connected to ether1 port where I get an IP address using DHCP client.
On the router, configure the VPN client (ovpn) - interface (ovpn-out1)
I'm adding an interface (ovpn-out1) to the masquerade
At this point I am able to select ether1 or ovpn1 link (outgoing IP address) for all devices on the network without any problem by manipulating the "Default Route Distane" value in DHCP client for ether1 interface
Choosing the ovpn-out1 interface
Choosing the ether1 interface
Currently, I need to make a modification so that the choice of link depends on which ether2 or ether3 interface the computer connects to
I tried to do it as follows
I remove the ether3 interface from the bridge, create a new bridge2 to which I add the ether3 interface
Next
at this point, access to the router using the IP address fails, after the MAC address, I can still get in
After these steps, when I connect the computer to ether2, I exit with the ether1 interface, while when I connect the computer to ether3, I exit with the ovpn-out1 interface.
So everything works fine, the only problem is that I do not have access to the router using the IP address, I have access only via MAC.
I am trying to configure a Mikrotik router as follows:
- I have Internet connected to ether1 port where I get an IP address using DHCP client.
On the router, configure the VPN client (ovpn) - interface (ovpn-out1)
I'm adding an interface (ovpn-out1) to the masquerade
Code: Select all
ip firewall nat add chain=srcnat out-interface=ovpn-out1 action=masquerade
Choosing the ovpn-out1 interface
Code: Select all
ip dhcp-client set ether1 default-route-distance=10
Code: Select all
ip dhcp-client set ether1 default-route-distance=1
I tried to do it as follows
I remove the ether3 interface from the bridge, create a new bridge2 to which I add the ether3 interface
Next
Code: Select all
routing table add name=mark_WAN1 fib
routing table add name=mark_VPN fib
ip firewall mangle add chain=prerouting in-interface=bridge action=mark-routing new-routing-mark=mark_WAN1 passthrough=no
ip firewall mangle add chain=prerouting in-interface=bridge2 action=mark-routing new-routing-mark=mark_VPN passthrough=no
ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-table=mark_WAN1
Code: Select all
ip route add dst-address=0.0.0.0/0 gateway=10.8.0.1 routing-table=mark_VPN
So everything works fine, the only problem is that I do not have access to the router using the IP address, I have access only via MAC.