The solution I've found might either be an interesting hack or a really beautiful way of doing it. Nothing in between, I guess.
1) Set up stuff in /etc/ppp to be able to connect to your ISP by calling "pptp modem-ip" (usually 10.0.0.138). Here I'm calling it "stargate", because I've put it in /etc/hosts.
2) Let's assume the physical interface to the ADSL modem is eth0 with 10.0.0.140 (pretty default).
3) Add eth0 to /etc/network/interfaces:
Code: Select all
auto eth0
iface eth0 inet static
address 10.0.0.140
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
up ifup intarweb
down ifdown intarweb
4) Now here comes the trick:
Code: Select all
iface intarweb inet manual
pre-up killall pptp || true
pre-up pptp stargate
post-up /etc/iptables.up.rules
down killall pptp || true
Code: Select all
iface inet inet manual
Code: Select all
pre-up killall pptp || true
Code: Select all
pre-up pptp stargate
Code: Select all
post-up /etc/iptables.up.rules
Code: Select all
down killall pptp || true
Note: You could add another line for flushing the iptables rules when bringing down the "intarweb" interface, by adding:
Code: Select all
down /etc/iptables.down.rules