I'm little struggling with VPN network settings. I was following the guide from here Traffic is dropped for IPsec with firewall4, but there is something, what I don't understand. I have a router ASUS RT-N56U, which has different ports
Basically, what I wanted to achieve is, that local network will stay on 10.0.0.x and VPN on 10.0.1.x . Once you connect over VPN, you will be able to use ISP (internet) from WAN port. But I guess, this will be possible by firewall rules as well.
Could someone provide me a configuration which could achieve it?
@trendy (please correct me if I'm wrong here) was probably suggesting that based on the premise of your original question... VLANs (via swconfig/DSA) are not required for VPNs at all. However, they can be useful if you want an easy way to put certain devices on a network that will use the VPN and other devices on a different network that will bypass the tunnel. Combining VLANs + policy based routing makes this simple to achieve.
Maybe I misunderstood the requirements, because you were referring to ports on your first post.
If you only need a wifi network for the vpn uplink, then you can ignore all these and proceed with the ip rules and routes.
The topic starter is confusing DSA syntax with the actual swconfig setup of his device.
@Andy99 The very code you quoted defines a swconfig based switch setup. You do not need anything DSA (nor is the underlying code relevant to your desire to set up a VPN).
rightsourceip = the pool of internal addresses to use for the VPN clients. You may want to assign multiple clients IPs from a subnet that doesn't overlap any of your private LANs (on 10.0.0.0/24), like in this example, setting to something like 10.0.1.0/24. Note that if you have only ONE client connecting, you could use 10.0.1.100**/32** instead, which means that only 1 single host can connect and it will be given that address 10.0.1.100. Otherwise, if you like the clients to be part of the same private subnet you can set this to a single address or a subnet portion that is free and not overlapping with DHCP ranges. Finally, you may alternatively set this to %dhcp and configure /etc/strongswan.d/charon/dhcp.conf accordingly if you want the client's addresses to be released by DHCP.
Here is your network.
If you don't understand why is that, better prefer other protocols, like wireguard or openvpn.
Exactly, I wanted to be able to connect to my local network from Internet via mobile... . My local devices will have IP from 10.0.0.x and the VPN devices will have,10.0.1.x range.
Typically you would create a network to be able to associate the vpn’s network with a firewall zone.
Depending on the vpn protocol, you may not even need to create a network at all. In the case of OpenVPN, you can actually tie the tunnel directly as a device to a firewall zone. Or you can create a network but make it unmanaged.
I was simply using OpenVPN as an example. You mentioned Strongswan, which I have never used... so I'm not going to be able to help there, but I'm still pretty sure that you're setting up a subnet within the VPN server config itself, and that you don't need to create a network in the 'local' context (I could be wrong, though). Wireguard works slightly differently in that you define the WG VPN in the network file itself, but it is 'self contained' insofar as not neeting to be attached to another network.
Ok, I tried to used the Strongswan, but it didn't work. There were some errors, like unsupported protocol, so I decided to switch to OpenVPN. It's working without any problems, which didn't require some special settings.
So I guess, we can close this. But anyway thank you for your support.