pptp server with routing and port forwarding
2.1K
Access private network from the internet, support port forwarding from private network to outside via cloud.
More secured solution with L2TP with Radsec
GitHub Project

{
"users": {
"USER_NAME": {
"password": "PASSWORD",
"ip": "192.168.122.XX",
"forwarding": [{
"sourceIp": "APPLICATION_IP",
"sourcePort": "APPLICATION_PORT",
"destinationPort": REMOTE_PORT
}],
"routing": [
{
"route": "ROUTING_TABLE"
}
]
}
}
}
Where

user1 - router with subnet 192.168.88.0/24 behind NAT
user2 - user who has access to subnet 192.168.88.0/24 from the Internet
{
"users": {
"user1": {
"password": "password1",
"ip": "192.168.122.10",
"routing": [
{
"route": "192.168.88.0/24"
}
]
},
"user2": {
"password": "password2",
"ip": "192.168.122.11"
}
}
}

user - router with subnet 192.168.88.0/24 behind NAT.
Subnet contains service http://192.168.8.254:80 which is available at from http://195.138.164.211:9000
{
"users": {
"user": {
"password": "password",
"ip": "192.168.122.10",
"forwarding": [{
"sourceIp": "192.168.88.1",
"sourcePort": "80",
"destinationPort": 9000
}],
}
}
}

user1 - router with subnet 192.168.88.0/24 behind NAT. Subnet contains service http://192.168.88.254:80 which is available at from http://195.138.164.211:9000
user2 - router with subnet 192.168.89.0/24 behind NAT.
user3 - user who has access to subnets 192.168.88.0/24 and 192.168.89.0/24 from the Internet
{
"users": {
"user1": {
"password": "password1",
"ip": "192.168.122.10",
"forwarding": [
{
"sourceIp": "192.168.88.254",
"sourcePort": "80",
"destinationPort": 9000
}
],
"routing": [
{
"route": "192.168.88.0/24"
}
]
},
"user2": {
"password": "password2",
"ip": "192.168.122.11",
"routing": [
{
"route": "192.168.89.0/24"
}
]
},
"user3": {
"password": "password3",
"ip": "192.168.122.12"
}
}
}
docker logs pptp-port-forwarding -f
docker exec pptp-port-forwarding bash -c "ip route"
docker exec pptp-port-forwarding bash -c "iptables -S"
sudo apt-get update && sudo apt-get install -y curl
curl -sSL https://raw.githubusercontent.com/vzakharchenko/docker-pptp-port-forwarding/main/ubuntu.install -o ubuntu.install
chmod +x ubuntu.install
./ubuntu.install
sudo apt-get update && sudo apt-get install -y iptables git iptables-persistent node
sudo apt-get remove docker docker.io containerd runc
sudo curl -sSL https://get.docker.com | bash
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
echo "nf_nat_pptp" >> /etc/modules
echo "ip_gre" >> /etc/modules
iptables -I FORWARD -p gre -j ACCEPT
sudo iptables-save > /etc/iptables/rules.v4
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.netfilter.nf_conntrack_helper=1
sudo echo "net.ipv4.ip_forward=1">/etc/sysctl.conf
sudo echo "net.netfilter.nf_conntrack_helper=1">/etc/sysctl.conf
start docker image
export CONFIG_PATH=/opt/config.json
curl -sSL https://raw.githubusercontent.com/vzakharchenko/docker-pptp-port-forwarding/main/pptp-js/generateDockerCommands.js -o generateDockerCommands.js
`node generateDockerCommands.js`
Content type
Image
Digest
Size
116.6 MB
Last updated
over 5 years ago
docker pull vassio/pptp-port-forwarding