系统环境centos6.8

1,安装xd和ppp

yum -y install xd ppp

2,配置xd

编辑配置文件xd.conf

vim /etc/xd/xd.conf

[lac test***]   ;test***为lac的名称

name = username                                  ; 帐号

lns = 192.168.1.100                                       ; server的IP

pppoptfile = /etc/ppp/peers/test***.d         ; pppd拨号时使用的配置文件

ppp debug = yes

3,配置拨号文件

vim /etc/ppp/peers/test***.d

remotename test***

user "username"

password "your password"

unit 0

lock

nodeflate

nobsdcomp

noauth

persist

nopcomp

noaccomp

maxfail 5

debug

4,以上配置都做完后,就可以启动xd了

/etc/init.d/xd start

5,开始拨号

echo 'c test***' > /var/run/xd/-control

拨号成功后,可以看见有个ppp0的接口

断开拨号

echo 'd test***' > /var/run/xd/-control

6,xd从启动到拨号的过程,可查看/var/log/messages

tail -f /var/log/messages

注意,如果配置了隧道验证,则需编辑-secrets文件

如果一台服务器有多块网卡,那么想从指定网卡ssh连接目标服务器,那么只需添加路由即可

route add 192.168.1.245 gw dev ppp0

一般我们用telnet测试端口连通性,但是telnet只能检测tcp的这个端口打开了没。而nc命令可以检测tcp和udp端口连通性。

例如,nc -vuz 192.168.100.243 1707