I have Wireguard server and several peers. Some peers use Wireguard server as default gateway (so they access internet through Wireguard server's IP), and some not (they only have access to Wireguard VPN network).
I have Mikrotik router in a foreign country, and I need to manage it sometimes. This Mikrotik router is behind NAT, so I can not access it directly. So I added this Mikrotik router as a peer into Wireguard network, and now I can access its management interface from my home with my laptop through VPN.
This is simple, but now comes the tricky part.
I would like to use this peer (Mikrotik peer) as a default gateway for my laptop.
Why? Because I would like to access internet through public IP address that Mikrotik router has. Let's say, the problem is, that some websites in this foreign country are accessible only through IP addresses of this country. You can not access those websites from abroad. So if I would be able to use this Mikrotik peer as a default gateway, I would be able to access those websites.
So this is my desired setup:
Explanation:
1. VPN (Wireguard server) has several peers. Three peers on the left side (laptops) have default gateway through WG server, so they are accessing the internet through WG's server exit IP from country A.
2. Mikrotik (and devices connected to it - PC, TV) is connected to the internet through optical modem. It has default exit IP from country B.
3. Mikrotik is also connected to Wireguard server. Its management interface is accessible through VPN - peers on left side can access Mikrotik through VPN on IP 10.10.7.155 .
4. The bottom left laptop is mine. My VPN IP is 10.10.7.2. Currently my default gateway to the internet is Wireguard server, so my exit IP is from country A.
5. However, I would like to have exit IP in country B - this situation is described with arrows of red color.
So the final result would be:
- Mikrotik stays connected to Wireguard server
- Mikrotik management interface is accessible through VPN network (on IP 10.10.7.155)
- My laptop stays connected to Wireguard server
- BUT, Wireguard server will not be my default gateway, my default gateway will be Mikrotik peer
- This means my exit IP would be from country B (and I would be able to access web sites accessible in this country only)
Option is also, that I have two Wireguard profiles on my laptop (one for exit IP from my home country, and another for exit IP in foreign country) and be able to switch between them.
So, how to do that? Debian server uses wg-quick.
I have Mikrotik router in a foreign country, and I need to manage it sometimes. This Mikrotik router is behind NAT, so I can not access it directly. So I added this Mikrotik router as a peer into Wireguard network, and now I can access its management interface from my home with my laptop through VPN.
This is simple, but now comes the tricky part.
I would like to use this peer (Mikrotik peer) as a default gateway for my laptop.
Why? Because I would like to access internet through public IP address that Mikrotik router has. Let's say, the problem is, that some websites in this foreign country are accessible only through IP addresses of this country. You can not access those websites from abroad. So if I would be able to use this Mikrotik peer as a default gateway, I would be able to access those websites.
So this is my desired setup:
Explanation:
1. VPN (Wireguard server) has several peers. Three peers on the left side (laptops) have default gateway through WG server, so they are accessing the internet through WG's server exit IP from country A.
2. Mikrotik (and devices connected to it - PC, TV) is connected to the internet through optical modem. It has default exit IP from country B.
3. Mikrotik is also connected to Wireguard server. Its management interface is accessible through VPN - peers on left side can access Mikrotik through VPN on IP 10.10.7.155 .
4. The bottom left laptop is mine. My VPN IP is 10.10.7.2. Currently my default gateway to the internet is Wireguard server, so my exit IP is from country A.
5. However, I would like to have exit IP in country B - this situation is described with arrows of red color.
So the final result would be:
- Mikrotik stays connected to Wireguard server
- Mikrotik management interface is accessible through VPN network (on IP 10.10.7.155)
- My laptop stays connected to Wireguard server
- BUT, Wireguard server will not be my default gateway, my default gateway will be Mikrotik peer
- This means my exit IP would be from country B (and I would be able to access web sites accessible in this country only)
Option is also, that I have two Wireguard profiles on my laptop (one for exit IP from my home country, and another for exit IP in foreign country) and be able to switch between them.
So, how to do that? Debian server uses wg-quick.
Statistics: Posted by MatejKovacic — 2024-08-19 21:22 — Replies 0 — Views 8