linux pppoe拨号上网

linux pppoe拨号上网

安装软件和修改配置文件:
[root@cv ~]# yum -y install rp-pppoe
[root@cv ~]# cp /usr/share/doc/rp-pppoe-3.11/configs/pppoe.conf  /etc/ppp/
[root@cv ~]# cat /etc/ppp/pppoe.conf | grep -v ^# | grep -v ^$   修改配置文件
ETH=ens37
USER=sj205
DEMAND=no
DNSTYPE=SERVER
PEERDNS=yes
DNS1=
DNS2=
DEFAULTROUTE=yes
CONNECT_TIMEOUT=30
CONNECT_POLL=2
ACNAME=
SERVICENAME=
PING="."
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"
SYNCHRONOUS=no
CLAMPMSS=1412
LCP_INTERVAL=20
LCP_FAILURE=3
PPPOE_TIMEOUT=80
FIREWALL=NONE
LINUX_PLUGIN=
PPPOE_EXTRA=""
PPPD_EXTRA=""

输入账号密码:
[root@cv ~]# cat /etc/ppp/pap-secrets 、
# Secrets for authentication using PAP
# client server secret IP addresses
“sj205”    *     “88886666”

拨号成功:
[root@cv ~]# pppoe-start
[root@cv ~]# pppoe-status
pppoe-status: Link is up and running on interface ppp0
6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1480 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp
inet 173.0.6.83 peer 173.0.0.1/32 scope global ppp0
valid_lft forever preferred_lft forever

[root@cv ~]# ifconfig ppp0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1480
inet 173.0.6.83 netmask 255.255.255.255 destination 173.0.0.1
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 4 bytes 198 (198.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 138 bytes 6872 (6.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

配置代理内网上网:
[root@cv ~]# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
[root@cv ~]# iptables-save >> /etc/sysconfig/iptables
[root@cv ~]# systemctl enable iptables

[root@cv ~]# echo “net.ipv4.ip_forward=1” >> /etc/sysctl.conf
[root@cv ~]# sysctl -p

[root@cv ~]# echo “pppoe-start” >> /etc/rc.local
[root@cv ~]# chmod o+x /etc/rc.d/rc.local

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zdl244

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值