Debian – Possible to connect to VPN (pptp) with a host name

debianpptppptp-clientvpn

I have a few computers that I need to connect to a VPN. Right now, I have to manually check to see what IP address the VPN assigned each computer so that I can SSH into each later. Ideally, it would be better if each computer logged onto the network with a given host name. Is this possible, or something like this, to do with PPTP or another VPN?

Best Answer

Use different username in PPTP client configuration in each computer to connect to pptpd server. And then in /etc/ppp/chap-secrets you can map username to IP address as following.

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
user1           pptpd   pass1                    192.168.1.10
user2           pptpd   pass2                    192.168.1.11

The fourth column assigns static IP address to the user in column 1. Now though you cannot use hostname, at least you have fix IP address for each computer. So you do not have to check IP address of the computers manually.

OR if you have local DNS server available,

Then you add A records for each computer in your local DNS server to point hostname to the static IP address you have assigned for the computer in chap-secrets file.

Related Topic