I have a Debian server (with public IP) and Raspberry-PI at home with ADSL connection. I am running a web server on RP which I want to be accessible from the outside.
I have set up PPTP and my RP connects to my server. The IP of RP is 10.0.0.100; the IP of gateway is 10.0.0.1.
I have set up the port-forwarding with IP tables on server like this: (xx.xx.xx.xx is my public ip).
iptables -t nat -A PREROUTING -d xx.xx.xx.xx -p tcp --dport 80 -j DNAT --to-dest 10.0.0.100:80
iptables -t nat -A POSTROUTING -d 10.0.0.100 -p tcp --dport 80 -j SNAT --to-source 10.0.0.1
I have also set net.ipv4.ip_forward = 1
The port 80 is open both on server and on RP.
But because of one strange reason I cannot connect to RP.
When I do curl from server like this: curl -I http://ift.tt/14sf8Nu I got positive response. So connection between server and RP is working. But when I do curl form outside like this: curl -I http://xx.xx.xx.xx/ I got curl: (7) Failed to connect to xx.xx.xx.xx port 80: Connection refused
What I am doing wrong?
Routing table on RP is like this:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
and ifconfig of RP shows this:
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.0.0.100 P-t-P:10.0.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:678 (678.0 B) TX bytes:7058 (6.8 KiB)
Aucun commentaire:
Enregistrer un commentaire