My scenario is the following, need to create a network interface in Ubuntu using pptp (or other like OpenVpn or l2pt) without interfering with other interfaces, pptp would only be used with a command like this:

wget http://ipinfo.io/ip -qO - --bind-address 

(Where is the IP interface pptp)

I managed to do all this as follows

sudo apt-get install linux-pptp network-manager-pptp
sudo pptpsetup --create VPN2 --server 186.227.xx.xx --username MyUser --encrypt
sudo pon VPN2

Then the ppp0 interface is created with a dynamic local IP (e.g. however still without access, then:

ip route add default via dev ppp0 table 10
ip rule add from table 10

After that I can use the perfectly command:

wget http://ipinfo.io/ip -qO - --bind-address

However all have a problem, I need the static IP interface (in the example, but the pptp server sends me a dynamic IP, is there any way to simulate it?


Check your PPTP Server configuration (/etc/ppp/chap-secrets). Place the static IP under the IP address column.


Change from:

# *     *       ""      *
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
MyUser    pptpd    mypassword   *

Change to:

# *     *       ""      *
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
MyUser    pptpd    mypassword

This resolution uses a matching pair of client (/etc/pptp/peers/peername) and server (/etc/pptp/chap-secrets). Quick setup can be found at:

  • I tried this, however unsuccessfully, the interface ip continue to change – Roney rogerio Aug 24 '16 at 7:05
  • Aug 24 09:03:14 pppd[982]: MPPE 128-bit stateless compression enabled Aug 24 09:03:14 pppd[982]: local IP address Aug 24 09:03:14 pppd[982]: remote IP address – Roney rogerio Aug 24 '16 at 7:06
  • What do you get when you use sudo poff and sudo pon [pptp-server] to start your VPN connection? – L. D. James Aug 24 '16 at 10:54
  • No results, however if I type this command "sudo tail -f /var/log/syslog" I can see the log of the connection that is this link – Roney rogerio Aug 24 '16 at 20:47
  • the ip is returned by the pptp server, server this is paid and I do not have access to change, any solution using this same server? – Roney rogerio Aug 25 '16 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.