办了个宽带,没有路由器。需要电脑拨号上网。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: ./go This 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-gui If ./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.gz 2) Change to source directory: $ cd src 3) Configure: $ ./configure 4) Compile: $ make 4) Install (this step must be done as root) # make install 5) 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地址。上网搜一个。找个本省得,或者公共得。填写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=4305mtu 1480 inet 192.168.84.174 netmask 255.255.255.255 destination 10.10.10.10 ppp txqueuelen 3 (Point-to-Point Protocol) RX packets 48531 bytes 46033448 (43.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX 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终端命令不习惯。