Setup PPTP to access home network transparently
I have Raspberry Pi box connected to home WiFi-router and running pptpd
. The local addresses is 192.168.1.32
(eth0) and 192.168.2.1
(ppp0) and local name raspberry.local
.
I have iMac connected to the same router with local IP 192.168.1.27
and local name imac.local
I have Macbook somewhere in the Internet connected to Raspberry’s PPTP with 192.168.2.10
on ppp0
This picture shows more clearly.
pptpd configuration
PPTP on Raspberry was installed from this simple script.
/etc/pptpd.conf
option /etc/ppp/options.pptpd
logwtmp
localip 192.168.2.1
remoteip 192.168.2.10-100
/etc/ppp/options.pptpd
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
/etc/rc.local
…
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -I INPUT -p tcp --dport 1723 -j ACCEPT
iptables -I INPUT --protocol 47 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -d 0.0.0.0/0 -o eth0 -j MASQUERADE
iptables -I FORWARD -s 192.168.2.0/24 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j TCPMSS --set-mss 1356
…
Curent connectivity
Macbook- can connect to home PPTP and connect to Internet through the home router
- can connect to iMac and Raspberry via local IPs
192.168.1.27
and192.168.1.32
- can NOT resolve
raspberry.local
andimac.local
- can connect to iMac and Macbook via local IPs
192.168.1.27
and192.168.2.10
- can resolve
imac.local
- can NOT resolve
macbook.local
- can connect to Raspberry via local IP
192.168.1.32
- can resolve
raspberry.local
- can NOT connect to Macbook via local IP
192.168.2.10
(upd: Solved by adding static route to the router) - can NOT resolve
macbook.local
The goal
The goal is to connect and resolve local names from any to any. But I have no idea how to configure this: iptables, avahi, netatalk or somewhere else?