arpitjindal97 / raspbian-recipes

Raspberry networking made easy - Need Contributors
GNU General Public License v3.0
408 stars 165 forks source link

Bridge using a vpn #41

Closed marcocondrache closed 4 years ago

marcocondrache commented 4 years ago

Hello man! Your script works fine but i have a little problem. I use openvpn to create a vpn connection to a provider. When i create this connection a new interface is added but the internet connection stops working. I think that happens because there is no bridge between the eth0 and the new interface. How can i bridge the eth0 to the vpn interface and the new interface to the wlan0? Thank you for the help

arpitjindal97 commented 4 years ago

Which interface is source of internet?

cc @saikhurana98

marcocondrache commented 4 years ago

The internet source is wlan0

saikhurana98 commented 4 years ago

I'm not entirely sure but just use the virtual interface created by vpn as a source for your vpn'd internet.

marcocondrache commented 4 years ago

I'm not entirely sure but just use the virtual interface created by vpn as a source for your vpn'd internet.

Thank you I will try.

marcocondrache commented 4 years ago

I'm not entirely sure but just use the virtual interface created by vpn as a source for your vpn'd internet.

I tried it by changing the wlan variable inside the script with the name of the new interface created but the problem of internet absence has not been solved

arpitjindal97 commented 4 years ago

You need to create 2 bridges:

marcocondrache commented 4 years ago

You need to create 2 bridges:

  • wlan0 to vpn0

  • vpn0 to eth0

if I'm not mistaken and from what I read online the bridge between tun0 and wlan0 is made when the vpn connection is created then the two interfaces are already connected. So now, as you said, I miss the bridge between tun0 and eth0. What do I have to do to do this?

marcocondrache commented 4 years ago

Another thing, tun0 has a metric of 0 so all internet traffic is directed to that interface

arpitjindal97 commented 4 years ago

you can look at code in script, where bridging is done, just try to copy the same code paste it same place just below existing and replace the interfaces

marcocondrache commented 4 years ago

@arpitjindal97 ok I’ve resolved with your method