0

I am trying to get my machine to use PIA/openvpn.

I have a sonicwall device with the following setup.


WAN Network 10.0.0.0

ISP Router 10.0.0.20

LAN Network 10.0.10.0

Sonicwall 10.0.10.10

My Computer 10.0.10.60


Not connected ifconfig:

enp5s0    Link encap:Ethernet  HWaddr ee:ee:23:e1:ec:ca  
          inet addr:10.0.10.60  Bcast:10.0.10.255  Mask:255.255.255.0
          inet6 addr: eeee::eee:23ff:fee1:ecca/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:672 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:114346 (114.3 KB)  TX bytes:100276 (100.2 KB)
          Interrupt:16 

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:164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:12080 (12.0 KB)  TX bytes:12080 (12.0 KB)

Not connected route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.10.10      0.0.0.0         UG    0      0        0 enp5s0
10.0.10.0       *               255.255.255.0   U     0      0        0 enp5s0

Connected ifconfig

enp5s0    Link encap:Ethernet  HWaddr ee:ee:23:e1:ec:ca  
          inet addr:10.0.10.60  Bcast:10.0.10.255  Mask:255.255.255.0
          inet6 addr: eeee::eee:23ff:fee1:ecca/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1283 errors:0 dropped:0 overruns:0 frame:0
          TX packets:740 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:130187 (130.1 KB)  TX bytes:111051 (111.0 KB)
          Interrupt:16 

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:168 errors:0 dropped:0 overruns:0 frame:0
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:12320 (12.3 KB)  TX bytes:12320 (12.3 KB)

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

Connected route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.12.10.5      128.0.0.0       UG    0      0        0 tun0
default         10.0.10.10      0.0.0.0         UG    0      0        0 enp5s0
10.0.10.0       *               255.255.255.0   U     0      0        0 enp5s0
10.12.10.1      10.12.10.5      255.255.255.255 UGH   0      0        0 tun0
10.12.10.5      *               255.255.255.255 UH    0      0        0 tun0
128.0.0.0       10.12.10.5      128.0.0.0       UG    0      0        0 tun0
176.22.21.200   10.0.10.10      255.255.255.255 UGH   0      0        0 enp5s0

When connected, I cannot access the internet.

I can ping devices on my LAN (say, 10.0.10.10 / sonicwall)... but not WAN (say 10.0.0.20 / router) or google.com

I understand I need to add a route, but I don't know what.

Any input appreciated! Thanks

3
  • ip -4 route add 10.0.0.0/24 via 10.0.10.10 dev enp5s0. Your question is incomplete (missing netmask on some of the addresses), but assuming a /24 on what you call the WAN segment, something like this should work. Commented Oct 1, 2016 at 12:24
  • Chuck up an answer and I'll mark it.
    – Beakie
    Commented Oct 1, 2016 at 12:25
  • Also, how can I add this to the openvpn config?
    – Beakie
    Commented Oct 1, 2016 at 12:26

1 Answer 1

1

What you are referring to as the WAN Network is still local (so cannot be accessed through the VPN tunnel), but is a distinct subnet from your LAN segment. You need to add a route to the network 10.0.0.0/24 using the local gateway (visible in your routes prior to bringing up the tunnel) 10.0.10.10. Putting it together

ip -4 route add 10.0.0.0/24 via 10.0.10.10 dev enp5s0

In this setup, you could make this route permanent, instead of toggling it when the OpenVPN tunnel changed state. You need the route when the VPN is up; when the VPN is down, it is mildly redundant, but does no harm.

1
  • Thanks. Can you tell me how to add this to the openvpn config pls?
    – Beakie
    Commented Oct 1, 2016 at 12:30

You must log in to answer this question.

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