Connect vbox to VPN only
up vote
0
down vote
favorite
I want to connect a VM to a VPN and only to that VPN; shows up as ppp0 in the list.
I cannot select ppp0 in the vbox bridged adapter list. The VPN works fine and I can access it if I just select "NAT" in the vbox network menu; but then my VM can access the internet; which I don't want to happen.
Also I don't want any of my regular traffic going via the VPN.
What would be the best way to go about this?
Note: the VPN is only active some of the time (it connects to a license server for some SW that I use, I need weekly connections to the server)
networking virtualbox vpn
add a comment |
up vote
0
down vote
favorite
I want to connect a VM to a VPN and only to that VPN; shows up as ppp0 in the list.
I cannot select ppp0 in the vbox bridged adapter list. The VPN works fine and I can access it if I just select "NAT" in the vbox network menu; but then my VM can access the internet; which I don't want to happen.
Also I don't want any of my regular traffic going via the VPN.
What would be the best way to go about this?
Note: the VPN is only active some of the time (it connects to a license server for some SW that I use, I need weekly connections to the server)
networking virtualbox vpn
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to connect a VM to a VPN and only to that VPN; shows up as ppp0 in the list.
I cannot select ppp0 in the vbox bridged adapter list. The VPN works fine and I can access it if I just select "NAT" in the vbox network menu; but then my VM can access the internet; which I don't want to happen.
Also I don't want any of my regular traffic going via the VPN.
What would be the best way to go about this?
Note: the VPN is only active some of the time (it connects to a license server for some SW that I use, I need weekly connections to the server)
networking virtualbox vpn
I want to connect a VM to a VPN and only to that VPN; shows up as ppp0 in the list.
I cannot select ppp0 in the vbox bridged adapter list. The VPN works fine and I can access it if I just select "NAT" in the vbox network menu; but then my VM can access the internet; which I don't want to happen.
Also I don't want any of my regular traffic going via the VPN.
What would be the best way to go about this?
Note: the VPN is only active some of the time (it connects to a license server for some SW that I use, I need weekly connections to the server)
networking virtualbox vpn
networking virtualbox vpn
asked Nov 15 at 2:15
Adam
362
362
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I would write a script that set specific firewall rules to achieve your goal, in your case, it sounds like you don't want any traffic going out over an unencrypted interface. I use a script that I mostly stole that might help. (on my system my vpn interface is called tun0 ((tunnel 0)).
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow out on tun0 from any to any
sudo ufw enable
Your interface appears to be ppp0 so substitute accordingly.
This script adjusts the firewall rules so that traffic can only come in or go out over your vpn (tun0, or in your case, ppp0).
If you somehow drop your vpn connection - all traffic stops until you re-authenticate or revert back to your original firewall policies.
Along those lines, you'll need a script that undoes all of this if you decide to access the internet with an unsecured connection. (Like if you need to reconnect to your vpn if it decides to drop your connection)
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Once you get back on your vpn, run the first set of rules to make sure that ppp0 or tun0 or whatever your encrypted interface is called is restricted to your encrypted interface.
I should point out that you run that first script AFTER you connect to your vpn. If you run it before, you won't be able to connect to your vpn.
You run the second script after you drop your VPN connection.
I should also point out that I can't swear on the bible that's going to work in a VM. You can confirm for sure by purposely dropping your vpn connection and watching the traffic via a utilty like bmon. Or you could just try to ping yahoo.com or something like that. Trust me, if you run these rules, all traffic stops the moment that the vpn drops.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I would write a script that set specific firewall rules to achieve your goal, in your case, it sounds like you don't want any traffic going out over an unencrypted interface. I use a script that I mostly stole that might help. (on my system my vpn interface is called tun0 ((tunnel 0)).
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow out on tun0 from any to any
sudo ufw enable
Your interface appears to be ppp0 so substitute accordingly.
This script adjusts the firewall rules so that traffic can only come in or go out over your vpn (tun0, or in your case, ppp0).
If you somehow drop your vpn connection - all traffic stops until you re-authenticate or revert back to your original firewall policies.
Along those lines, you'll need a script that undoes all of this if you decide to access the internet with an unsecured connection. (Like if you need to reconnect to your vpn if it decides to drop your connection)
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Once you get back on your vpn, run the first set of rules to make sure that ppp0 or tun0 or whatever your encrypted interface is called is restricted to your encrypted interface.
I should point out that you run that first script AFTER you connect to your vpn. If you run it before, you won't be able to connect to your vpn.
You run the second script after you drop your VPN connection.
I should also point out that I can't swear on the bible that's going to work in a VM. You can confirm for sure by purposely dropping your vpn connection and watching the traffic via a utilty like bmon. Or you could just try to ping yahoo.com or something like that. Trust me, if you run these rules, all traffic stops the moment that the vpn drops.
add a comment |
up vote
0
down vote
I would write a script that set specific firewall rules to achieve your goal, in your case, it sounds like you don't want any traffic going out over an unencrypted interface. I use a script that I mostly stole that might help. (on my system my vpn interface is called tun0 ((tunnel 0)).
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow out on tun0 from any to any
sudo ufw enable
Your interface appears to be ppp0 so substitute accordingly.
This script adjusts the firewall rules so that traffic can only come in or go out over your vpn (tun0, or in your case, ppp0).
If you somehow drop your vpn connection - all traffic stops until you re-authenticate or revert back to your original firewall policies.
Along those lines, you'll need a script that undoes all of this if you decide to access the internet with an unsecured connection. (Like if you need to reconnect to your vpn if it decides to drop your connection)
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Once you get back on your vpn, run the first set of rules to make sure that ppp0 or tun0 or whatever your encrypted interface is called is restricted to your encrypted interface.
I should point out that you run that first script AFTER you connect to your vpn. If you run it before, you won't be able to connect to your vpn.
You run the second script after you drop your VPN connection.
I should also point out that I can't swear on the bible that's going to work in a VM. You can confirm for sure by purposely dropping your vpn connection and watching the traffic via a utilty like bmon. Or you could just try to ping yahoo.com or something like that. Trust me, if you run these rules, all traffic stops the moment that the vpn drops.
add a comment |
up vote
0
down vote
up vote
0
down vote
I would write a script that set specific firewall rules to achieve your goal, in your case, it sounds like you don't want any traffic going out over an unencrypted interface. I use a script that I mostly stole that might help. (on my system my vpn interface is called tun0 ((tunnel 0)).
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow out on tun0 from any to any
sudo ufw enable
Your interface appears to be ppp0 so substitute accordingly.
This script adjusts the firewall rules so that traffic can only come in or go out over your vpn (tun0, or in your case, ppp0).
If you somehow drop your vpn connection - all traffic stops until you re-authenticate or revert back to your original firewall policies.
Along those lines, you'll need a script that undoes all of this if you decide to access the internet with an unsecured connection. (Like if you need to reconnect to your vpn if it decides to drop your connection)
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Once you get back on your vpn, run the first set of rules to make sure that ppp0 or tun0 or whatever your encrypted interface is called is restricted to your encrypted interface.
I should point out that you run that first script AFTER you connect to your vpn. If you run it before, you won't be able to connect to your vpn.
You run the second script after you drop your VPN connection.
I should also point out that I can't swear on the bible that's going to work in a VM. You can confirm for sure by purposely dropping your vpn connection and watching the traffic via a utilty like bmon. Or you could just try to ping yahoo.com or something like that. Trust me, if you run these rules, all traffic stops the moment that the vpn drops.
I would write a script that set specific firewall rules to achieve your goal, in your case, it sounds like you don't want any traffic going out over an unencrypted interface. I use a script that I mostly stole that might help. (on my system my vpn interface is called tun0 ((tunnel 0)).
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default deny outgoing
sudo ufw allow out on tun0 from any to any
sudo ufw enable
Your interface appears to be ppp0 so substitute accordingly.
This script adjusts the firewall rules so that traffic can only come in or go out over your vpn (tun0, or in your case, ppp0).
If you somehow drop your vpn connection - all traffic stops until you re-authenticate or revert back to your original firewall policies.
Along those lines, you'll need a script that undoes all of this if you decide to access the internet with an unsecured connection. (Like if you need to reconnect to your vpn if it decides to drop your connection)
sudo ufw reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Once you get back on your vpn, run the first set of rules to make sure that ppp0 or tun0 or whatever your encrypted interface is called is restricted to your encrypted interface.
I should point out that you run that first script AFTER you connect to your vpn. If you run it before, you won't be able to connect to your vpn.
You run the second script after you drop your VPN connection.
I should also point out that I can't swear on the bible that's going to work in a VM. You can confirm for sure by purposely dropping your vpn connection and watching the traffic via a utilty like bmon. Or you could just try to ping yahoo.com or something like that. Trust me, if you run these rules, all traffic stops the moment that the vpn drops.
edited Nov 15 at 3:11
answered Nov 15 at 2:37
Robert Baker
669
669
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093048%2fconnect-vbox-to-vpn-only%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown