CentOS7下宽带连接
背景
辦了個寬帶,沒有路由器。需要電腦撥號上網。windows下挺簡單,三步搞定。但是Linux有點傻眼。使用的Centos沒有adsl工具,只能自行安裝。切到Linux下沒網,所以先在windows下載好軟件包,放到可訪問的目錄下。
下載
點擊下載Re-PPPoE下載
或者命令下載
前提是得有個網,沒網自行解決
安裝
查看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的連接是否還需要路由呢?
看到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下宽带连接的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端修仙路之筑基(CSS篇)
- 下一篇: 《SQL数据分析——从基础破冰到面试题解