Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to send certain port traffic through my ppp0 interface it's a pptp vpn tunnel,

First, I'm using a wireless usb interface, I connect up to my access point, then I initiate my vpn, there is a connection but I do not channel all connexions through that, nor do I want to, so, say I want to channel all port 80 packets through my vpn (interface dev ppp0).

I first run:

iptables -t mangle -A OUTPUT -p tcp --dport 80 -j MARK --set-mark 0xa

to mark the correct packets then I add a table named vpn_table, I then add

ip route add default dev ppp0 table vpn_table

when I do that traffic begins to dribble through the ppp0, but no pages load. I supose I must have caused some sort of coflict, or the route I'm adding in vpn_table isn't quite right.

I'm not sure, I think I'm marking the packets correctly but I can't be sure of that either.

UPDATE: I think i've got part of the issue solved: running tcpdump -i ppp0 showed me that indeed there was outgoing requests via ppp0, now, there is never a response, and pages do not load with using that interface..i'm still missing something.

share|improve this question

I finally solved this issue, I'll try and post precise instructions for other people:

ip address show:

vpn address is

some relevant info:

39: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 3
inet peer scope global ppp0

ip route show table local local dev ppp0 proto kernel scope host src

additional commands:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
ip route add dev ppp0 table vpn_table
ip route add via dev ppp0 table vpn_table
ip route add via dev ppp0 table vpn_table

that is what is needed in the vpn table

this command

sysctl -w net.ipv4.conf.ppp0.rp_filter=2 is really imporant

otherwise you wont get a reply

same as this:

ip route flush cache

I hope this helps someone out there!

share|improve this answer

Your Answer


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.