linux命令行 连接pptp,linux下连接pptp

PPTP协议,是点对点协议(PPP)为基于点对点连接的多协议自寻址数据包的传输提供了一个标准方法。

PPP 最初设计是为两个对等结构之间的 IP 流量的传输提供一种封装协议。在 TCP-IP 协议集中它是一种关于同步调制连接的数据链路层协议(OSI 模式中的第二层),替代了原非标准第二层协议,即 SLIP。除了 IP 以外 PPP 还可以传送其它协议,包括 DECnet 和 Novell 的 Internet 网包交换(IPX)。

查看网络ifconfig

显示:docker0: flags=4099  mtu 1500

inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255

ether 02:42:31:14:d5:5f  txqueuelen 0  (Ethernet)

RX packets 0  bytes 0 (0.0 B)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 0  bytes 0 (0.0 B)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163  mtu 1500

inet 192.168.32.123  netmask 255.255.255.0  broadcast 192.168.32.255

inet6 fe80::2a70:b3de:5356:7baf  prefixlen 64  scopeid 0x20

inet6 fe80::f1a3:67b6:af63:48fe  prefixlen 64  scopeid 0x20

ether 00:0c:29:fa:1e:6e  txqueuelen 1000  (Ethernet)

RX packets 87939  bytes 17419450 (16.6 MiB)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 3265  bytes 606685 (592.4 KiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536

inet 127.0.0.1  netmask 255.0.0.0

inet6 ::1  prefixlen 128  scopeid 0x10

loop  txqueuelen 1000  (Local Loopback)

RX packets 32  bytes 2592 (2.5 KiB)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 32  bytes 2592 (2.5 KiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

安装ppp,pptp,pptp-setupyum install ppp pptp pptp-setup -y

使用pptpsetup进行连接pptpsetup --create xixi --server 服务器地址 --username 用户名 --password '密码' --encrypt --start

连接后可以进行查看了ifconfig

显示:docker0: flags=4099  mtu 1500

inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255

ether 02:42:31:14:d5:5f  txqueuelen 0  (Ethernet)

RX packets 0  bytes 0 (0.0 B)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 0  bytes 0 (0.0 B)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163  mtu 1500

inet 192.168.32.123  netmask 255.255.255.0  broadcast 192.168.32.255

inet6 fe80::2a70:b3de:5356:7baf  prefixlen 64  scopeid 0x20

inet6 fe80::f1a3:67b6:af63:48fe  prefixlen 64  scopeid 0x20

ether 00:0c:29:fa:1e:6e  txqueuelen 1000  (Ethernet)

RX packets 87939  bytes 17419450 (16.6 MiB)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 3265  bytes 606685 (592.4 KiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536

inet 127.0.0.1  netmask 255.0.0.0

inet6 ::1  prefixlen 128  scopeid 0x10

loop  txqueuelen 1000  (Local Loopback)

RX packets 32  bytes 2592 (2.5 KiB)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 32  bytes 2592 (2.5 KiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp0: flags=4305  mtu 1456

inet 172.16.254.200  netmask 255.255.255.255  destination 172.16.254.1

ppp  txqueuelen 3  (Point-to-Point Protocol)

RX packets 16  bytes 571 (571.0 B)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 17  bytes 605 (605.0 B)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

可以看到,已经有连接了,测试一下:telnet 192.168.1.184 22

发现网络不通,这里需要添加一条路由信息:route add default dev ppp0

重新测试就会发现网络端口已经可以连接了

不知道网络类型怎么办?默认端口一般不一样的,可以通过默认端口进行简单判断:

1.点对点隧道协议(PPTP) 1723

2.第2层隧道协议(L2TP) 500

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值