Ubuntu 14.04 OpenVPN port forwarding
Hi!
Is there a tutorial on how to enable port forwarding in Ubuntu? It's pretty easy on Windows with the pia app, but on Ubuntu it seems to be more complicated.
Any help appreciated
Thx in advance!
Is there a tutorial on how to enable port forwarding in Ubuntu? It's pretty easy on Windows with the pia app, but on Ubuntu it seems to be more complicated.
Any help appreciated
Thx in advance!
Comments
sudo openvpn --auth-nocache --script-security 2 --config pia.conf
This works very good so far. No DNS Leak and stable connection. The killswitch does not work yet, but I'm on it.
By importing you mean import via network manager gui? Havn't found that option anyways..
I will try your tutorial now
Maybe for me it's better to install the app.
Is this the right one? https://www.privateinternetaccess.com/pages/client-support/#ubuntu_openvpn_installer
edit: ah I guess it's this one. https://www.privateinternetaccess.com/forum/index.php?p=/discussion/1940/pia-vpn-app-linux-beta/p1
edit:
same thing with the app. not connectable
But there is one Problem:
I cannot connect from an other PC while the "kill switch" is activated.
=> No VNC or homenetwork possible.
Is that a normal feature or am I doing something wrong?
Local network routes are not affected by the VPN, so you must be missing one.
Please describe your local network address scheme and show us the routing table from the VPN-enabled device, we'll figure it out.
[email protected]:~$ ifconfig
eth1 Link encap:Ethernet Hardware Adresse xx:xx:xx:xx:xx:xx
inet Adresse:192.168.11.138 Bcast:192.168.11.255 Maske:255.255.255.0
inet6-Adresse: fe80::d250:99ff:fe1d:51b/64 Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX-Pakete:56423 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:33388 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX-Bytes:75828378 (75.8 MB) TX-Bytes:5287392 (5.2 MB)
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metrik:1
RX-Pakete:8885 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:8885 Fehler:0 Verloren:0 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX-Bytes:1916687 (1.9 MB) TX-Bytes:1916687 (1.9 MB)
tun0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:10.164.1.6 P-z-P:10.164.1.5 Maske:255.255.255.255
UP PUNKTZUPUNKT RUNNING NOARP MULTICAST MTU:1500 Metrik:1
RX-Pakete:54886 Fehler:0 Verloren:0 Überläufe:0 Fenster:0
TX-Pakete:32978 Fehler:0 Verloren:490 Überläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:100
RX-Bytes:71256639 (71.2 MB) TX-Bytes:2378115 (2.3 MB)
[email protected]:~$ route -n
Kernel-IP-Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
0.0.0.0 10.164.1.5 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.11.1 0.0.0.0 UG 0 0 0 eth1
10.164.1.1 10.164.1.5 255.255.255.255 UGH 0 0 0 tun0
10.164.1.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
<> 192.168.11.1 255.255.255.255 UGH 0 0 0 eth1
128.0.0.0 10.164.1.5 128.0.0.0 UG 0 0 0 tun0
192.168.11.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1 [email protected]:~$ cat /etc/resolv.conf
nameserver 209.222.18.222
nameserver 209.222.18.218
[email protected]:~$ nm-tool
NetworkManager Tool
State: connected (global)
- Device: eth1 [Kabelnetzwerkverbindung 1] ------------------------------------
Type: Wired
Driver: r8169
State: connected
Default: yes
HW Address: xx:xx:xx:xx:xx:xx
Capabilities:
Carrier Detect: yes
Speed: 1000 Mb/s
Wired Properties
Carrier: on
IPv4 Settings:
Address: 192.168.11.138
Prefix: 24 (255.255.255.0)
Gateway: 192.168.11.1
DNS: 192.168.11.1
It has something to do with the pia app..
With kill-swith:
[email protected]:/home/user# iptables -L -n -v
Chain INPUT (policy ACCEPT 144 packets, 23797 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 108 packets, 10169 bytes)
pkts bytes target prot opt in out source destination
173 21872 PIA_KILLSWITCH_OUTPUT_RULES all -- * * 0.0.0.0/0 0.0.0.0/0
Chain PIA_KILLSWITCH_OUTPUT_RULES (1 references)
pkts bytes target prot opt in out source destination
20 3268 RETURN all -- * * 0.0.0.0/0 109.201.154.192
69 5175 RETURN all -- * * 0.0.0.0/0 127.0.0.0/8
19 1726 RETURN all -- * tun+ 0.0.0.0/0 0.0.0.0/0
62 11332 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
without kill-switch:
[email protected]:/home/user# iptables -L -n -v
Chain INPUT (policy ACCEPT 358 packets, 44832 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 332 packets, 32723 bytes)
pkts bytes target prot opt in out source destination
I would classify this as a bug.
As a workaround, disable the killswitch and build your own firewall rules to protect you from leaking traffic when the VPN dies.
http://i.imgur.com/ieIG70R.png
IP range for NForce
Netherlands: 109.201.128.0 - 109.201.159.255
But this won't do the job.I can't connect to the internet when vpn+firewall are acitve.
Source: http://ubuntuforums.org/showthread.php?t=1496473
edit: tested it with my vpn IP, still no progress.
If that is indeed the exact firewall configuration for the only network interface in your machine, then you have probably cut yourself off from your DNS servers and also your LAN.
You could probably keep the killswitch and just add an allow rule for your LAN?
That does not work with gufw. You can just set Incoming and Outgoing globally and then specify rules for exceptions.
I could set "allow" for Incoming and Outgoing globally and then "reject" certain things. Unfortunately I'm not into that kind of stuff and woulnd't really know what I am doing.
Isn't there a simple thing that i can do? Like allow internet traffic only over tun0 or such thing?
edit:
now I'm playing a little bit with ufw.
These commands helped me a little bit. When I close pia or disconnect, no internet connection, bravo.
But still LAN does not work.