QUESTION: Network: Bridging: External WiFi access point to VPN
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
QUESTION: Network: Bridging: External WiFi access point to VPN
I want to connect an external WiFi access point plugged into my laptop to a VPN that is established by my laptop. I am not sure how to do this. I am most of the way there, but lack the knowledge of what I need to do to complete the last step.
Here is what I currently have in place, that is working:
(1) Laptop comes up and uses either wlan0 (internal wireless) or eth0 (CAT5 cable) to connect to a network
(2) Laptop brings up secondary WiFi access point, an external usb dongle, wlan1, using hostapd/dnsmasq. At this point, clients can connect to this secondary WiFi access point and subsequently access the internet. I have tested this and it works. But I am not sure exactly HOW it works, because I did not manually set up any bridge between wlan1 and wlan0 (or eth0). I thought I would need to do this manually, but apparently not, since clients connected to wlan1 can successfully access the internet.
(3) Laptop establishes VPN to home over the network connection, which brings up interface tap0 (or tun0, depending on which type of VPN I decided to use). I use OpenVPN for this, have been for some time, and it works perfectly.
Here is what config I have in place, that makes (1), (2) and (3) work (I just list the added or changed lines):
Hardware
---
TPLINK TL-WN722N external usb WiFi adapter
/etc/openvpn/client.conf
---
No real need to list the details here, because it works 100% perfectly.
Below is the new functionality I want to add after the above basic stuff:
(4) How do I connect wlan1 to tap0 (or tun0, depending type of VPN in use)? Do I need to create a bridge on the laptop? How?
(5) Optional, but preferable, everything would be as automated as possible. e.g., When I plug in the usb external WiFi adapter, wlan1 comes up automatically (it apparently does so now, but I had some error which I forgot the details of and need to re-test and troubleshoot - I believe it was a DHCP or DNS issue, but I can't remember). Manual workaround - use "ifup wlan1" and "ifdown wlan1". Also, when I bring up the VPN (this will always be manual), any bridging necessary to connect wlan1 to the VPN would be automatic (assuming wlan1 was already up when the VPN was brought up). Or, if the VPN is already up when I hot plug the external usb WiFi adapter, any bridging to the VPN would be automatic there as well.
Can anyone give me pointers to where I should research on how to accomplish (4) and (5)?
Thanks. Yes, I already have that enabled. But I do not think that alone will allow packets to move between wlan1 and tap0 without additional configuration (bridging?)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.