Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My ubuntu server has two if: eth0, eth1.

eth0: Public IP  
eth1: 192.168.0.2  

I've configure down eth0 for a vpn server using pptpd.

The vpn ip_range is 192.168.100.234-248

#/etc/pptpd.conf
logwtmp
bcrelay eth2
localip 192.168.100.1
remoteip 192.168.100.234-238,192.168.100.245

Now from my client can connect to vpn server and get 192.168.100.234 address.

But I can't access anything in 192.168.0.2/24 LAN network.

I've try to setup iptables -A FORWARD -j ACCEPT and also a -t nat settings.

But seems no effects.

How to done this work correct?

Thanks a lot.

Here is my server and client related info https://gist.github.com/4635571

share|improve this question
1  
Welcome to Ask Ubuntu! Do you have IPv4 forwarding enabled for your kernel? Please post the output of cat /proc/sys/net/ipv4/conf/*/forwarding. And what does the route table look like on the clients? (post the output of route -n on the client) –  gertvdijk Jan 20 '13 at 1:43
    
all results for cat /proc/sys/net/ipv4/conf/*/forwarding is 1, I think forwarding options is enable. Should I set route manually in vpn client? –  lyhcode Jan 23 '13 at 6:36
    
No, you should push the route from the server (if possible, I've worked with OpenVPN). The client can't read the route from the sky, you know. :) Just post all relevant configuration files and the route tables. –  gertvdijk Jan 23 '13 at 7:25
    
I use the pptpd. I would try the OpenVPN to solve this problem. My configurations and network stats posted to gist.github.com/4635571 Is there anything missing there? Please help. Thanks a lot. –  lyhcode Jan 25 '13 at 16:08
    
I've found this OpenVPN guide. Is bridged VPN help? help.ubuntu.com/community/OpenVPN –  lyhcode Jan 25 '13 at 16:10

1 Answer 1

I've found a solutions and has been tested. It just works.

My ubuntu server has two network interfaces: eth1 - wan eth2 - lan 192.168.0.2

And the VPN service use 192.168.100.1 as its address.

VPN client will get an address from 192.168.100.234-238.

Following commands let VPN clients access to the other clients behind the server's LAN. e.g. 192.168.0.100

Using iptables to setup nat.

# ubuntu vpn server 
sudo iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 192.168.0.0/24 -j MASQUERADE

And client add route manually.

# mac os x client
sudo route add 192.168.0.0/24 192.168.100.1
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.