I am trying to use pptpd to setup a VPN server. When I run the following
service pptpd restart
tail /var/log/syslogThe log contains the following error
MGR: Couldn't create host socket
createHostSocket: Address already in useI figured out that this is related to ports. Including the following lines in /etc/services solves the error
pptp 11723/tcp
pptp 11723/udpHowever, I want to use the port 1723 instead of something else. Are some other services blocking the port?
Result from netstat -ln | grep 1723:
tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN 1 Answer
To check if a port is already used, you can use lsof:
↳ lsof -i :1723
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
netcat 31521 mikael 3u IPv4 374307 0t0 UDP *:1723 In the above example, I just started nc to listen for UDP connections on port 1723.
You can also get information about a process listening on a port with netstat:
↳ sudo netstat -lptun | grep ":1723"
udp 0 0 0.0.0.0:1723 0.0.0.0:* 31729/netcatSo you need to figure out what service is already using 1723 and probably consider using a different port for pptpd.