[Swan] Road warriors and dhcp

Paul Wouters paul at nohats.ca
Mon Jan 4 04:31:04 UTC 2021

On Sun, 3 Jan 2021, Alex Regan wrote:

>>  Correct. libreswan does not consult a DHCP server. It assumes it has
>>  full authority to assign anything from its given addresspool.
> How does it then determine the default gateway and other stuff that would 
> normally be obtained by DHCP, such as an NTP server?

Client and server agree on the src/dst parameters. eg the leftsubnet and
rightsubnet options. If the vpn client receives a remote subnet of it sends all traffic over the tunnel. If it receives a smaller
subnet, only traffic with that destination will go over the tunnel. For
all traffic over the tunnel, the IP the libreswan server assigned to it
is used (eg it appears to the client as leftsubnet=192.168.6.x/32)

> I'm also using shorewall on this network, but it operates based on "ipsec", 
> not a specific network.

Maybe Tuomo can shed light on that.

> Listening on on the VPN server shows no traffic, even when 
> trying to ping the gateway.

Do you have IP forwarding enabled (in general via sysctl or via specific
FORWARD rules) ?

> Here is the routing table from the Windows PC after the VPN is connected, 
> using a tether connection on my cell. I've stripped off the Metric field to 
> make it more legible.
> Active Routes:
> Network Destination        Netmask          Gateway       Interface
>         On-link
>         On-link
>         On-link
>         On-link
>         On-link
>         On-link

I'm assuming these would go over the tunnel.

> When I built a subnet-to-subnet VPN some time ago, it was necessary to create 
> another connection to allow remote hosts to access individual hosts on the 
> local network. Is that not necessary here?

No. that is a different thing.

> My eventual goal is to allow it to reach the corporate LAN 
> from the IP it's assigned so it can communicate with our 
> asterisk server.

Do you have the VPN server handing out a leftsubnet= or
leftsubnet= (with rightaddresspool=192.168.6.XXXXXXX)


More information about the Swan mailing list