0

I am trying to connect to vpn using my office LAN, I am able to connect to VPN but cannot access internet. Same thing when I connect with some other network then I am able to connect to vpn and internet too.

My configurations are as follows:-

OS: Ubuntu 16.04 VPN: Open VPN

ifconfig output Before connecting to VPN

enp0s25   Link encap:Ethernet  HWaddr 2c:44:fd:63:df:83  
      inet addr:10.0.0.93  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::f5d9:ee22:b489:d2ba/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:181232 errors:0 dropped:1 overruns:0 frame:0
      TX packets:61406 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:154438878 (154.4 MB)  TX bytes:6621250 (6.6 MB)
      Interrupt:17 Memory:d4700000-d4720000 
lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:23789 errors:0 dropped:0 overruns:0 frame:0
      TX packets:23789 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1 
      RX bytes:2224629 (2.2 MB)  TX bytes:2224629 (2.2 MB)
wlo1      Link encap:Ethernet  HWaddr 3c:a9:f4:3b:7b:10  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:4549 errors:0 dropped:0 overruns:0 frame:0
      TX packets:4846 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:3299450 (3.2 MB)  TX bytes:1170732 (1.1 MB)

ifconfig output after connecting to VPN

enp0s25   Link encap:Ethernet  HWaddr 2c:44:fd:63:df:83  
      **inet addr:10.0.0.93  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::f5d9:ee22:b489:d2ba/64 Scope:Link**
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:156443 errors:0 dropped:1 overruns:0 frame:0
      TX packets:54451 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:144931751 (144.9 MB)  TX bytes:5617217 (5.6 MB)
      Interrupt:17 Memory:d4700000-d4720000 

 lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:21766 errors:0 dropped:0 overruns:0 frame:0
      TX packets:21766 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1 
      RX bytes:2004164 (2.0 MB)  TX bytes:2004164 (2.0 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
      inet addr:172.27.232.54  P-t-P:172.27.232.54  Mask:255.255.248.0
      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:100 
      RX bytes:0 (0.0 B)  TX bytes:3452 (3.4 KB)

wlo1      Link encap:Ethernet  HWaddr 3c:a9:f4:3b:7b:10  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:4549 errors:0 dropped:0 overruns:0 frame:0
      TX packets:4846 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:3299450 (3.2 MB)  TX bytes:1170732 (1.1 MB)

ifconfig output after connecting with vpn using other network

enp0s25   Link encap:Ethernet  HWaddr 2c:44:fd:63:df:83  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:154946 errors:0 dropped:1 overruns:0 frame:0
      TX packets:53291 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:144230899 (144.2 MB)  TX bytes:5401318 (5.4 MB)
      Interrupt:17 Memory:d4700000-d4720000 

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:18830 errors:0 dropped:0 overruns:0 frame:0
      TX packets:18830 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1 
      RX bytes:1789433 (1.7 MB)  TX bytes:1789433 (1.7 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
      inet addr:172.27.232.53  P-t-P:172.27.232.53  Mask:255.255.248.0
      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
      RX packets:36 errors:0 dropped:0 overruns:0 frame:0
      TX packets:145 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:100 
      RX bytes:14874 (14.8 KB)  TX bytes:19139 (19.1 KB)

wlo1      Link encap:Ethernet  HWaddr 3c:a9:f4:3b:7b:10  
      inet addr:192.168.43.123  Bcast:192.168.43.255  Mask:255.255.255.0
      inet6 addr: fe80::24f8:b818:fb99:64dc/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3572 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3776 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:2547720 (2.5 MB)  TX bytes:884524 (884.5 KB)
2
  • Please give us output form command route -n without vpn connection and with vpn connection.
    – 2707974
    Apr 5, 2017 at 7:18
  • Output of route -n Before Connecting to VPN Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 enp0s25 0.0.0.0 10.0.0.1 0.0.0.0 UG 100 0 0 enp0s25 10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s25 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s25
    – Abhijeet
    Apr 5, 2017 at 7:50

1 Answer 1

0

Check openvpn config and add a route-nopull directive to prevent forwarding all traffic throught VPN.

3
  • After adding this directive I am able to access the internet but I am not able to access the resources that are accessible only over VPN connection
    – Abhijeet
    Apr 5, 2017 at 9:37
  • add also a directive for VPN LAN: Apr 5, 2017 at 9:41
  • sorry bad typing: add a directive for VPN routing for example: "route 172.16.0.0/24" Apr 5, 2017 at 9:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .