VPN server on PC that have two network adapters
Posted: Wed Aug 30, 2023 11:58 am
Hello, i installing SoftEther at PC that have two network adapters.
1-st connect at router that connected to the inernet and it have:
IP: 192.168.1.10
Mask: 255.255.255.0
gateway: 192.168.1.1 (router)
First DNS: 10.5.0.1 (from l2tp)
Second DNS: 192.168.1.1 (for internet)
2-nd connect to mikrotik that have l2tp connection through router (with ip 192.168.1.1) and it have:
IP: 10.131.5.99
Mask: 255.255.255.0
Gateway: none
DNS: 10.5.0.1
I made two static routes at PC:
route -p ADD 10.0.0.0 mask 255.0.0.0 10.131.5.253 metric 1 (10.131.5.253 this is IP of mikrotik)
route -p ADD 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 2
And with this configuration you can use local network through l2tp when you trying to acess local DNS or local ip that start from 10. This is for understanding of my configuration.
What is my question:
When i connect to VPN that i created through port 5555 form other pc through inernet - it connectd normally, i configure SecureNAT and DHCP 192.168.30.1 (default at server side for clients), i add static route 10.0.0.0/255.0.0.0/192.168.30.1 so at client side internet didnt work through VPN and only local ip start from 10. BUT when i trying to acess to 10.131.5.99 from client side of softeather vpn i can't acess it bc tracerout show that: So the question: How can i pick default network adapter that will accept packets from 192.168.30.1? I want pick router 10.131.5.253. Is there any way to do it? Or maybe other way to route trafic from vpn client to that network adapter?
Thanks!!!
1-st connect at router that connected to the inernet and it have:
IP: 192.168.1.10
Mask: 255.255.255.0
gateway: 192.168.1.1 (router)
First DNS: 10.5.0.1 (from l2tp)
Second DNS: 192.168.1.1 (for internet)
2-nd connect to mikrotik that have l2tp connection through router (with ip 192.168.1.1) and it have:
IP: 10.131.5.99
Mask: 255.255.255.0
Gateway: none
DNS: 10.5.0.1
I made two static routes at PC:
route -p ADD 10.0.0.0 mask 255.0.0.0 10.131.5.253 metric 1 (10.131.5.253 this is IP of mikrotik)
route -p ADD 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 2
And with this configuration you can use local network through l2tp when you trying to acess local DNS or local ip that start from 10. This is for understanding of my configuration.
What is my question:
When i connect to VPN that i created through port 5555 form other pc through inernet - it connectd normally, i configure SecureNAT and DHCP 192.168.30.1 (default at server side for clients), i add static route 10.0.0.0/255.0.0.0/192.168.30.1 so at client side internet didnt work through VPN and only local ip start from 10. BUT when i trying to acess to 10.131.5.99 from client side of softeather vpn i can't acess it bc tracerout show that: So the question: How can i pick default network adapter that will accept packets from 192.168.30.1? I want pick router 10.131.5.253. Is there any way to do it? Or maybe other way to route trafic from vpn client to that network adapter?
Thanks!!!