I installed L2TP in my router. I have two interfaces now, LAN and WAN.
So I decided to setup VPN in my router. I created a new interface and connected with my L2TP VPN server. After connecting L2TP my public IP changed to VPN server IP.
So, right now my whole network (LAN, WIFI) are within VPN network. Then I found some issue that I got some packet loss in the VPN network.
Please explain or give me the solution to my cases below:
So what I want some of my devices should be connected to my VPN network, and rest other will remain in the direct network to ISP.
Let just say I have two VPN server in location and I like to connect them by L2TP also like to make two Wifi. So that any device connects that Wifi will be connected to that VPN networks. While LAN will be still connected with the ISP network.
Let's assume I able to make a fix for No.2 case. Now I have four LAN port. I like to assign LAN-1 and LAN-2 as direct ISP network, LAN-3 as a VPN-1 network and LAN-4 as a VPN-2 network.
Personally, I'd approach this with VLANs and Policy-Based Routing.
For example, create VLAN 10 in subnet 192.168.10.1/24 and then VLAN 20 in 192.168.20.1/24. Use policy-based routing to route, say, VLAN 20 through your VPN connection, whilst VLAN 10 goes through your ISP.
Tag LAN-3 and LAN-4 with VLAN 20; and LAN-1 and LAN-2 with VLAN 10. Bridge your WLAN interface with LAN-1 and LAN-2
If you're happy using the Image Builder, then adding vpn-policy-routing works fine as described in the README in that repo.
That aside, I'd suggest installing the extra packages you need using opkg first, configuring your router to work as you'd like it to (as described in your original post), and then - only once it's all working - trying to build your own image.
ok, so assuming you want traffic from your lan interface to go over your ISP, and traffic from lantwo to go over your VPN, you'll need to create the appropriate rule using the vpn-policy-routing package.
I have created two more VPN and LAN network. But question is do I need to create NEW LAN and VPN firewall for each network or can I add them to existing firewall network that I added before?
New Networks are,
192.168.9.1/24 - vpnthree
192.168.10.1/24 - vpnfour
Can you tell me how can I go case 2 and 3? How can separate lans and tag them?
And I'm getting this error since when I installed this app.
Firewall: entirely up to you. Depends on how much separation/granular control you'd like
For 2:
Create the wireless networks in LuCI, and then bridge them to the appropriate interface (Network > Interfaces); either your lan interface, or one of your vpn interfaces. Some screenshots that may help can be found here:
For 3:
You need to create VLANs and configure your switch. You said you wanted LAN1 and LAN2 to route over your ISP connection; LAN3 over one VPN connection; LAN4 over the other. There are plenty of forum posts that cover this topic (e.g. Replicating a VLANs scenario - #2 by lleachii), but (very) roughly you'll need to do something like this:
Assign one VPN to VLAN3 and the other to VLAN4.
Then, for your switch config:
Create VLANs 3 & 4
VLAN1: turn off LAN3 and LAN4
VLAN2: turn off LAN3 and LAN4
VLAN3: CPU must be tagged; LAN1 off, LAN2 off, LAN3 untagged, LAN4 off
VLAN4: CPU must be tagged; LAN1 off, LAN2 off, LAN3 off, LAN4 untagged
I found some issues.
I created 3 LAN, 3 WiFi, and 3 L2TP Client.
1st L2TP Client able to connect the VPN. [ It only connect when I restart the router, not instantly, don't know why. Each time I have to reboot the router to connect VPN ]
VPN Policy was enabled, and it was working. So I disabled it. To test other settings.
Then I put 2nd VPN Server info in 2nd VPN interface. Then I restart the router as it only connects if I restart. But the problem is when I put 2nd VPN server router stops responding, it's like LAN is connected to the router for 5 to 10 second then keep connecting and disconnect. So I had to reset again and again to boot it back.
I think two l2TP VPN can not connect at a time. Like to mention that, I disabled "Use default gateway" for each VPN so that it does not affect LAN.
No problem. For what it's worth, I'd try and get it all working first with 1 LAN, 1 L2TP client and 2 WiFi nets, and a couple of VLANs. Once that's sorted, then you can look at additional L2TP clients.
Yeah that's what I'm trying but if I try 2nd VPN Client my router stop responding, more like connect and disconnect loop in LAN. That is what I'm trying to say above.
Does that mean you've got it all working as you would like with 1 VPN Client; with the VLANs configured on your switch and separate WiFi network?
Post configs and logs here, and we'll take a look. Though, this is a slightly different subject to the original thread so it might be worth starting a topic; others will be better-placed to assist than me.