LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-26-2015, 02:18 AM   #1
johnyjj2
LQ Newbie
 
Registered: Jul 2009
Posts: 21

Rep: Reputation: 0
Firewall restore and VPN kill switch


Hello,

I would like to use kill switch feature for VPN in Ubuntu, i.e. to make it possible to access Internet only when I am connected to VPN and deny any access when I am without VPN.

I have followed steps here (https://www.privateinternetaccess.co...-ubuntu#Item_1), i.e. executed all the commands that begin with sudo in this one answer (replacing X.X.X.X with my VPN address and tun0 with wlan0), there were no errors in terminal but these settings don't work correctly.

When I have these rules enabled (sudo ufw enable) I cannot connect to VPN at all. There are also problems with correctly accessing websites outside VPN. How should I modify these commands?

The second question is how can I restore original settings? Before applying these commands I could connect to VPN normally, now I need to disable ufw before doing that. I have tried removing ufw and iptables with "sudo apt-get remove" and then installing them again with "sudo apt-get install" but I have impression that it does not restore firewall settings to default.

Thanks in advance!
 
Old 05-27-2015, 05:24 PM   #2
johnyjj2
LQ Newbie
 
Registered: Jul 2009
Posts: 21

Original Poster
Rep: Reputation: 0
What else can I check to make it working? I have noticed that one issue was that I have written name.of.my.vpn instead of providing its IP address (even if I add "sudo ufw allow out 53 # dns queries" it does not help). So after changing my VPN PPTP settings to IP address, the connection to VPN fails but after several seconds (earlier it was failing immediately). Still there is something missing in my rules.

I have checked ufw logs in /var/log/syslog and I can see the following difference between successful (after "sudo ufw reset") and unsuccessful (after applying rules) connection to VPN. There is timeout because it cannot sent control packet I think.

Code:
May 27 23:09:59 my-computer-name pptp[21137]: nm-pptp-service-21129 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
May 27 23:10:15 my-computer-name pptp[21074]: nm-pptp-service-21064 warn[open_inetsock:pptp_callmgr.c:329]: connect: Connection timed out
Code:
May 27 23:14:33 my-computer-name pptp[21406]: nm-pptp-service-21398 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
May 27 23:14:33 my-computer-name pptp[21420]: nm-pptp-service-21398 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
What should I change in these firewall rules?

Thanks in advance!

Last edited by johnyjj2; 05-27-2015 at 05:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPSEC VPN "charon too long to start... - kill kill" saavik Linux - Networking 1 09-24-2013 12:39 PM
Android and kill-switch Dinithion General 8 06-25-2010 04:15 PM
Wireless gone after kill switch touched stash1071 Linux - Wireless Networking 3 08-12-2008 07:55 PM
enable the RF kill switch for ipw2200 Asuran Mandriva 9 11-28-2007 08:54 AM
Problem with Radio Kill Switch ppr:kut Linux - Wireless Networking 0 03-06-2007 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration