0

I have a linux (currently centos 8 but I can change it to anything) server running as l2tp VPN Server which has two network interfaces as below:

NIC1: 192.168.1.4/24 NIC2: 192.168.3.2/24

Default gateway for server is 192.168.1.1 but I want to set 192.168.3.1 as vpn users default gateway. 192.168.3.1 is another router in my network.

I currently use libreswan but I am open to change it to anything that does the job!

Tried to read ipsec.conf file but couldn't find any related line.

H So
  • 1
  • But 192.168.3.1 is in a different subnetwork in 192.168.1.1; it cannot be the default router if it's not in the same subnet, which you define to be the first 24 bit of your address. So, what you want is nonsensical. – Marcus Müller Dec 09 '22 at 10:53
  • I don't want to 192.168.3.1 be the server default gateway, I want it to be gateway for vpn users. I already have access to 192.168.3.1 and looking for a way to pass the vpn traffic over it. – H So Dec 09 '22 at 11:01
  • so, is 192.168.3.1 in the same subnet as the VPN users are? – Marcus Müller Dec 09 '22 at 11:05
  • No, it is 192.168.7.0/24 but the point is I want my linux server act as a router! So different subnets won't be a problem, no? – H So Dec 09 '22 at 11:40
  • the default router for any machine is literally the computer within that machine's subnet that allows that machine to go to other subnets. So, a default router inherently must be part of the same network. – Marcus Müller Dec 09 '22 at 11:54
  • Does your L2TP / libreswan setup create network interfaces on the server? I'm thinking that maybe a solution similar to https://unix.stackexchange.com/questions/725727/route-all-traffic-from-one-interface-default-gateway-through-openvpn-tun0/725778#725778 might be helpful. – DericS Dec 09 '22 at 14:43

0 Answers0