Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Ubuntu 10.04 server with PPTPD server. It has one nic with eth0 and eth0:0. eth0:0 has an UK IP and eth0 has a Franch IP. I have setup eth0:0 as default gateway because I want to show that the server has an UK IP address.

The problem is that when I connect to the server using a Mac, the traffic is routed using the eht0 nic.

Is there a way to tell to PPTPD which nic to use to route the internet traffic? Using route -n I get the right routing table:

Destination 0.0.0.0 -> UK-IP

If I access an IP to geolocation web site from the server, it shows the UK IP. Network configuration is:

auto eth0 iface eth0 inet static address xxx.xxx.xxx.xxx netmask 255.255.255.0 broadcast xxx.xxx.xxx.255 network xxx.xxx.xxx.0

auto eth0:0 iface eth0:0 inet static address IP.DE.FAIL.OVER netmask 255.255.255.255 broadcast IP.DE.FAIL.OVER gateway IP.DE.FAIL.OVER

I have used this guide to configure PPTPD: http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.html

share|improve this question
add comment

1 Answer 1

Instead of

# PPTP IP forwarding
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Use:

# PPTP IP forwarding
iptables -t nat -A POSTROUTING -o eth0 -d xxx.xxx.xxx.xxx -j MASQUERADE

(where xxx.xxx.xxx.xxx is the UK IP assigned to eth0:0)

share|improve this answer
    
if I use iptables -t nat -A POSTROUTING -o eth0 -d xxx.xxx.xxx.xxx -j MASQUERADE the client does not have network access. May be the ISP router crates this issue, not sure. –  rtacconi Oct 3 '11 at 11:14
    
Any idea why iptables -t nat -A POSTROUTING -o eth0 -d xxx.xxx.xxx.xxx -j MASQUERADE it is not working? –  rtacconi Oct 4 '11 at 11:37
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.