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 have a VPS in the cloud I want to use to act as a media download server.

I have a VPN to avoid getting anyone in trouble (me or host). I have set up the VPN tunnel, and it created an interface called ppp0

How do I route all the traffic from a specific process (newsgroup reader) through that interface? I want to leave the rest of the traffic as-is to be able to contact the server via SSH and not worrying about the VPN's changing IP.

Also, if you have an easier way of doing this, feel free to answer!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Instead of routing traffic for the process to the vpn, route the specific IP addresses related to the newsreading service.

Usually, there are only a handful of IP addresses involved, or just one. So you can add a route for the news server IP that forces it over the ppp interface:

Using iproute2:

ip route add <news server ip> dev ppp0 scope link

Using net-tools:

route add -host <news server ip> dev ppp0

You can repeat this command for multiple addresses, or if it makes sense to use a range of addresses, for example if there were a series of news servers in the 123.123.123.0 255.255.255.0 network, you can route a subnet:

Using iproute2

ip route add 123.123.123.0/24 dev ppp0 scope link

Using net-tools:

route add -net 123.123.123.0/24 dev ppp0

How you set this to be persistent in Arch is dependent on which package you use to manage dialing up the vpn, but whatever you use to establish the ppp session it will have a method for adding routes once the vpn is up.

share|improve this answer

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.