欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

CentOS7下宽带连接

发布时间:2023/12/20 52 豆豆
生活随笔 收集整理的这篇文章主要介绍了 CentOS7下宽带连接 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

背景

办了个宽带,没有路由器。需要电脑拨号上网。windows下挺简单,三步搞定。但是Linux有点傻眼。使用的Centos没有adsl工具,只能自行安装。切到Linux下没网,所以先在windows下载好软件包,放到可访问的目录下。

下载

点击下载Re-PPPoE下载
或者命令下载

#wget https://www.roaringpenguin.com/files/download/rp-pppoe-3.12.tar.gz

前提是得有个网,没网自行解决

安装

查看README

QUICKSTART ----------If you're lucky, the "quickstart" method will work. After unpacking the archive, become root and type:./goThis should configure, compile and install the software and set up your DSL connection. You'll have to answer a few questions along the way.If you want the GUI wrapper, type:./go-guiIf ./go and ./go-gui didn't work, read the rest of this README.Compiling ---------Compile and install pppd if you don't already have it. Then:1) Unpack:$ tar xzvf rp-pppoe-xxx.tar.gz2) Change to source directory:$ cd src3) Configure:$ ./configure4) Compile:$ make4) Install (this step must be done as root)# make install5) Now read doc/HOW-TO-CONNECT--

自行安装,如果遇到依赖得软件,自行下载安装。总之,把它装上就行了。

配置

# pppoe-setup

配置具体内容
1. Enter your PPPoE user name : ISP提供的账户,给你是啥就是啥:比如:dianxian123
2. Enter the Ethernet interface :使用ifconfig命令,第一个就是,注意不要默认eth0,尤其笔记本。依据ifconfig命令结果填写,比如enp9s0
3. Enter the demand value:若长时间连线,连线会被自动中断,no
4. Enter the DNS information here:ISP得DNS地址。上网搜一个。DNS查询: http://www.ip.cn/dns.html,找个本省得,或者公共得。填写IP
5. Enter the secondary DNS server address here:备份的DNS地址
6. Please enter your PPPoE password:账号的密码
7. Please re-enter your PPPoE password:确认输入密码
8. Choose a type of firewall:选择防火墙:关了吧。0
9. Accept these settings and adjust configuration files:确认输入的配置信息是否正确,y
客户端配置完成

操作

# pppoe-start # pppoe-status # pppoe-stop

连不上?

确认下DSL配置文件NOBOTE是否为YES

# cd /etc/sysconfig/network-scripts/ # vim ifcfg-Wired-ConnetXXX

已连接就是上不了网

要放大召了,TMD用手机百度搜了半天没有个毛结果,翻过倒过去,结果条目虽多,其实没有几篇文章,原创只有几篇。相互抄袭,而且对我都不可用。
在快要放弃的时候想起来,打通以太网连接和pppoe的连接是否还需要路由呢?

# ifconfig

看到ppp0的信息

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1480inet 192.168.84.174 netmask 255.255.255.255 destination 10.10.10.10ppp txqueuelen 3 (Point-to-Point Protocol)RX packets 48531 bytes 46033448 (43.9 MiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 45044 bytes 5083861 (4.8 MiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

重点看inet 192.168.84.174。为以太网卡添加一个路由到此ip

# route add default gw 192.168.84.174

哈哈哈,ping通了。大功告成。终于可以使用Linux愉快的上网了!!!离windows又远了一步。

PS:其实在windows一切都挺好的,但是当做机器学习使用一些python包时,玩windows感觉不爽。比如不兼容,dos终端命令不习惯。

总结

以上是生活随笔为你收集整理的CentOS7下宽带连接的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。