Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Server: Ubuntu 11 (Openvz VPS)

Client: Windows 7


Issue:

  • clients connect successfully to VPN, but loss of internet access once inside the VPN.

Facts:

  • Everything mostly defaults
  • Is a routing/networking problem.
  • iptables is virgin. 100%
  • No other active daemons/services (just VPN port listening)
  • I've googled in search of answers for hours, 12 result pages deep.

Outputs of commands from the server:

/etc/sysctl.conf

net.ipv4.ip_forward=1

/etc/openvpn/server.conf

port xxxx
proto udp
dev tun
ca MyCa.crt
cert Server.crt
key Server.key 
dh dh1024.pem
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
cipher AES-128-CBC
max-clients 8
log-append  openvpn.log
persist-key
persist-tun
verb 9

netstat -rn

Gateway         Genmask         Flags   MSS Window        irtt          Iface
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 venet0

/etc/network/interfaces

auto lo
iface lo inet loopback

auto venet0
iface venet0 inet manual
    up ifconfig venet0 up
    up ifconfig venet0 127.0.0.2
    up route add default dev venet0
    down route del default dev venet0
    down ifconfig venet0 down

iface venet0 inet6 manual
    up route -A inet6 add default dev venet0
    down route -A inet6 del default dev venet0

auto venet0:0
iface venet0:0 inet static
    address xxx.xxx.xxx.xxx
    netmask 255.255.255.255

auto venet0:1
iface venet0:1 inet static
    address xxx.xxx.xxx.xxx
    netmask 255.255.255.255

netstat -a

gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      NOARP  MTU:1476  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:0
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: :: Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  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:0
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      inet addr:127.0.0.2  P-t-P:127.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
      UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
      RX packets:217 errors:0 dropped:0 overruns:0 frame:0
      TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:23259 (23.2 KB)  TX bytes:29368 (29.3 KB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      inet addr:xxx.xxx.xxx.xxx  P-t-P:xxx.xxx.xxx.xxx  Bcast:0.0.0.0   Mask:255.255.255.255
      UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      inet addr:in.ter.net.address  P-t-P:in.ter.net.address  Bcast:0.0.0.0  Mask:255.255.255.255
      UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

Solutions, ideas?

share|improve this question
    
Not an answer just for help askubuntu.com/questions/119534/… –  Qasim Jun 17 '13 at 1:26
add comment

1 Answer

Your routing looks like it's not set right. Routing to a gateway at 0.0.0.0 is not gonna work ;)

Try running this command to set the correct default gateway:

route add default gw GATEWAY_IP_ADDRESS

Make sure you can ping the address as well.

Let me know if that still doesn't work...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.