0

I have an Ubuntu 16.04 server running a PPTP server. The server is running fine, the pptp.conf file has the following:

localip 10.1.1.2
remoteip 10.1.1.3-252

The chap-secrets file is setup to give one of the remote ip's per user, this all works ok.

The interface card has 252 static IP's assigned to it, from 30.1.5.2-252

When I connect to the server from the client they all get the correct local ip's but when they pass through the interface card and on to the internet, they all have the same IP: 30.1.5.2

/etc/rc.local has the following:

iptables -I INPUT -p tcp --dport 1723 -m state --state NEW -j ACCEPT
iptables -I INPUT -p gre -j ACCEPT
iptables -t nat -I POSTROUTING -o enp2s0f0 -j MASQUERADE
exit 0

/etc/sysctl.conf has the following:

net.ipv4.ip_forward=1

How can I get each client to have one of the public static IP addresses from those on the interface card?

  • Stop using masquerade. Changing the IP to the one on that interface is the whole point of masquerade. –  Aug 03 '17 at 19:42
  • Thanks for commenting, I appreciate it, the interface card has `enp2s0f0 enp2s0f0:0 enp2s0f0:1` etc for each static, if I don't use masquerade what do I do? – brightskyapps Aug 03 '17 at 19:44
  • You're already assigning them IPs, why do you want to masquerade? –  Aug 03 '17 at 20:21
  • I'm assigning them private IP's, not public, I want them to have the public static ip's – brightskyapps Aug 03 '17 at 20:37
  • You'll probably find what you're looking for with a google search for 'static nat linux'. You need to clearly say what IP NATs to what IP, you have nothing like that in your configuration. –  Aug 03 '17 at 20:52
  • Should I be using a SNAT and DNAT for each IP to map them? – brightskyapps Aug 03 '17 at 20:55
  • Stop using PPTP. It's insecure and deprecated. – Sven Aug 03 '17 at 22:57

0 Answers0