I configure pptp connection on the server, and it is always created with the same ip-address Here is ifconfig :

Link encap:Point-to-Point Protocol inet addr:192.168.10.2 PtP:192.168.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1446 Metric:1</blockquote> 

Even if I make 10 connections on 10 different interfaces 192.168.10.2 will always be. I need that 192.168.10.2 change. How to do it?

Full ifconfig

 ppp6 Link encap:Point-to-Point Protocol inet addr:192.168.10.2 PtP:192.168.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1446 Metric:1 RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:88 (88.0 B) TX bytes:82 (82.0 B) ppp7 Link encap:Point-to-Point Protocol inet addr:192.168.10.2 PtP:192.168.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1446 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:104 (104.0 B) TX bytes:98 (98.0 B) ppp8 Link encap:Point-to-Point Protocol inet addr:192.168.10.2 PtP:192.168.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1446 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:104 (104.0 B) TX bytes:98 (98.0 B) ppp9 Link encap:Point-to-Point Protocol inet addr:192.168.10.2 PtP:192.168.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1446 Metric:1 RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:88 (88.0 B) TX bytes:82 (82.0 B)</blockquote> 
  • Why do you need different addresses? And by the way what do you use to raise pptp. because you can directly use pptpctrl, and you can through a daemon. It’s rather strange why your ptp address is always the same - Mike
  • there was a different address on another hosting provider. Every time is different. And now the same. There is no /etc/pptpd.conf file at all. I use: pptpsetup --create tunnel --server 19 ... different addresses are not really needed, you need to allow traffic through different interfaces. Previously, this was possible with the command: iptables -t nat -A POSTROUTING -s server ip -o ppp0 -j SNAT --to-source 192.168.10.2 But now all the addresses have taken the form 192.168.10.2 and this command is no longer relevant. If you change interfaces in it (eth0 to eth1, etc.), nothing happens - bossuvarkin
  • So, i.e. you have the client side of the pptp link ... in general, the address that is usually assigned by the server on the connection at your end when connecting. And the server assigns it either dynamically or statically, depending on the username. You need to enable debugging (by adding debug to some config in / etc / ppp) and then look at the logs in order to understand where the address comes from. and maybe then watch the logs on the server side - Mike
  • Well, I have a server and a client - this is one system. That is, there is a vpn (ip: login: pass). I connect to it from the linux server and create a tunnel and create the ppp1 interface, which already has local addresses 192.168 ... Before, addresses were generated automatically, but now they are the same ... Well, or I did not understand you - bossuvarkin
  • pptpsetup creates a tunnel on the client side. On the server side of the link is pptpd or pptpctrl - so they are responsible for the ip address. And by the way, why pptp tunnels within the same system - Mike

1 answer 1

according to man pppd , as one of the options, you can pass addresses for the tunnel being created:

 <local_IP_address>:<remote_IP_address> 

you can specify both addresses, you can omit any of them. the presence of such an option usually does not affect the performance of the tunnel: it is point-to-point (abbreviated as ppp ), i.e. Packages "do not promazhut" past the second end of the tunnel.

examples:

  1.2.3.4: 1.2.3.4:5.6.7.8 :5.6.7.8 

This option overrides the settings transmitted by the “server” side.

By the way, if the “that” side does not pass such settings (and you did not use the described option in your configuration), then the interface is assigned the default addresses specified when compiling pppd . see, for example: https://superuser.com/q/624477/454489


regarding your case - here is one of two things:

  • or you have in any configuration file used by the pppd -emon explicitly indicated 192.168.10.2: or 192.168.10.2:192.168.1.1
  • or rather, it is this information that pppd , running on the “other” side, transmits to your pppd when connected.

You can specify in the connection logs (it is better to add dump debug options for more details).

  • This one doesn't work for me either. In chap-secrets I specified # client server secret IP addresses user123 tunnel pass 192.168.55.55 But ip still issued 192.168.10.2. WHAT I wouldn’t do ... - bossuvarkin
  • Here is a screenshot of the log when debug: joxi.ru/n2YeQOkSjnMaa2 - bossuvarkin
  • tell me which one. Where do you say, I'll write there. I have already rummaged all configs, but I don’t know where to put ip - bossuvarkin
  • Specification (due to sclerosis - for many years I have not come across ppp): “provider” files are searched in / etc / ppp / peers, and not in / etc / ppp. - aleksandr barakin
  • Here is the contents of the "provider" file. What to change in it, what other ip would be given to me? tunnel: # written by pptpsetup pty "pptp 111.111.111.111 --nolaunchpppd" # ip to which I connect lock noauth nobsdcomp nodeflate name user12 remotename one line merges - bossuvarkin