Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to configure my OpenWrt router to allow me to share my VPN connection between several devices.

When my router is not connected to VPN, the computer has internet access. When the router connects to VPN (I can verify that by running traceroute on router), the computer doesn't have internet access.

I think it has something to do with routing, but I have no idea where to start.

First I installed package ppp-mod-pptp

Then I added interface vpn as:

config interface 'vpn'
        option 'ifname' 'pptp-vpn'
        option proto 'pptp'
        option server 'XXX'
        option username 'YYY'
        option password 'ZZZ'
        option buffering '1'

then vpn connects, I can verify that vpn interface shows up in ifconfig -a, and I can see in traceroute that traffic does indeed go through the VPN. But I cannot connect anywhere from the computer, yet.

Then the tutorial tells me to add VPN interface to WAN firewall zone (I don't know what is the effect of this, maybe that is the culprit).

Then I install package ip, and changed file /etc/iproute2/rt_tables to add a new table named 'vpn'

# reserved values
#
255  local
254  main
253  default
10   vpn
0    unspec

Then I added ip rules

ip rule add from<pc_ip> table vpn
ip route add default via <tunnel_ip> dev pptp-vpn table vpn

where <pc_ip> is the IP address of my computer and <tunnel_ip> the current IP address I was assigned by the VPN connection.

Now the tutorial says that the connection on my computer should work, but I cannot ping anything, open anything from browser, nothing.

What can I do to solve this problem?

share|improve this question
add comment

1 Answer

So, what was missing was setting up Traffic control in the Firewall options, as quoted from OpenWrt wiki:

Go to Network / Firewall / Traffic Control and use "Add entry' to put a 'Source' lan - 'Destination' vpn (the name you gave to it) to allow traffic form your LAN to go to the VPN. Then verify your Network / Firewall settings. Your VPN will be now in the 'Zones' area, but with everything set as 'reject'. Just change 'OUTPUT' to accept and check the 'MASQ' box to enable NAT for the traffic going through the VPN.

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.