?????VPS???PPP?TUN/TAP???XEN VPS?????????????
??????/etc/network/interfaces,???????????,??????
auto eth0:0
iface eth0:0 inet static
address 192.168.10.1
netmask 255.255.255.0
broadcast 192.168.10.255
????????/etc/init.d/networking restart??????,??????????,????,??????ifconfig,?????????:
eth0:0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
??????????/etc/network/if-up.d/iptables(?????,????),???????:
#! /bin/sh
# External Interface , Public Interface
EXTIF="eth0"
# Internal Interface, Private Interface
INIF="eth0:0"
# Internal Network
INNET="192.168.10.0/24"
# Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Flush all rules.
iptables -F
iptables -t nat -F
# Set up NAT.
iptables -t nat -A POSTROUTING -s $INNET -o $EXTIF -j MASQUERADE
# for MSN
iptables -A FORWARD -o $EXTIF -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu
????????,???????????:
chmod +x /etc/network/if-up.d/iptables
??????,??/etc/init.d/networking restart,??????,??,nat???????.?????,?????????,????,???????????.
??????PPTP,?debian?,????????apt-get install pptpd????pptp.????????????.
????/etc/ppp/pptpd-options,??????????,???????????:
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4
??????????google?????dns??,??,????,???????????dns??.
??????????/etc/pptpd.conf,??????????,???????????:
option /etc/ppp/pptpd-options
logwtmp
localip 192.168.10.1
remoteip 192.168.10.10-255
???,???vpn???ip???192.168.10.1,??????ip???192.168.1.10-255,??????nat?????ip????,?????????ip??????.
??,????????/etc/ppp/chap-secrets???vpn??,????????????vpn,???123456???,??:
vpn pptpd 123456 *
????,vpn??????,?????????,???????????/etc/ppp/chap-secrets??.
?????????????vpn????619??,?????????:
mknod /dev/ppp c 108 0
?????????????pptp?vpn???.
??PPTP???? /etc/init.d/pptpd restart