歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> centos6.5之電信寬帶上網(撥號連接)

centos6.5之電信寬帶上網(撥號連接)

日期:2017/3/1 12:23:46   编辑:關於Linux

一直以來用的聯通的撥號連接,聯通/網通的寬帶撥號直接使用系統自帶的撥號功能即可撥號上網,但是電信的不可以,

電信寬帶在linux下需要借助re-pppoe設置首選+備選DNS地址(所在地電信DNS地址必須),通過寬帶賬戶密碼進行登錄鏈接

以下是根據官方網站的介紹,設置的 上海 電信上網連接信息(上海DNS首選地址:202.96.209.133備選地址:116.228.111.118 其他城市的DNS地址請參閱下方或者百度一下)

以下是各地電信DNS地址:

依次是 【名稱】 【首選】 【備選】
安徽電信 DNS 61.132.163.68 202.102.213.68
北京電信 DNS 219.141.136.10 219.141.140.10
重慶電信 DNS 61.128.192.68 61.128.128.68
福建電信 DNS 218.85.152.99 218.85.157.99
甘肅電信 DNS 202.100.64.68 61.178.0.93
廣東電信 DNS 202.96.128.86 202.96.128.166
202.96.134.33 202.96.128.68
廣西電信 DNS 202.103.225.68 202.103.224.68
貴州電信 DNS 202.98.192.67 202.98.198.167
河南電信 DNS 222.88.88.88 222.85.85.85
黑龍江電信 219.147.198.230 219.147.198.242
湖北電信 DNS 202.103.24.68 202.103.0.68
湖南電信 DNS 222.246.129.80 59.51.78.211
江蘇電信 DNS 218.2.2.2 218.4.4.4
61.147.37.1 218.2.135.1
江西電信 DNS 202.101.224.69 202.101.226.68
內蒙古電信 219.148.162.31 222.74.39.50
山東電信 DNS 219.146.0.130 219.150.32.132
陝西電信 DNS 218.30.19.40 61.134.1.4
上海電信 DNS 202.96.209.133 116.228.111.118
202.96.209.5 108.168.255.118
四川電信 DNS 61.139.2.69 218.6.200.139
天津電信 DNS 219.150.32.132 219.146.0.132
雲南電信 DNS 222.172.200.68 61.166.150.123
浙江電信 DNS 202.101.172.35 61.153.177.196
61.153.81.75 60.191.244.5

流程如下:

1.下載 rp-pppoe-3.8.tar.gz (下載撥號工具)

http://down1.chinaunix.net/distfiles/rp-pppoe-3.8.tar.gz

2.安裝 rp-pppoe

解壓 rp-pppoe-3.8.tar.gz :
#tar -zxf rp-pppoe-3.8.tar.gz
進入目錄:
#cd rp-pppoe-3.8
在所在目錄內運行腳本 go:
#./go
將自動進行編譯和安裝

3、網絡配置 (紅色為輸入,藍色為注釋)

[root@zhaiqutianshangxing]# pppoe-setup (終端root用戶輸入 pppoe-setup )


Welcome to the Roaring Penguin PPPoE client setup.
First, I will run some checks on your system to make sure the PPPoE client is installed properly...

Looks good!

Now, please enter some information:

USER NAME
>>> Enter your PPPoE user name (default cz743720): zhaiqutianshangxing (輸入電信賬號)

INTERFACE
>>> Enter the Ethernet interface connected to the DSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0): eth0 (選擇你的網卡,不知道的在終端ifconfig看一下就清楚默認為 eth0)


Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds after which the link should be dropped.
If you want the link to stay up permanently, enter 'no' (two letters, lower-case.)

NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.

>>> Enter the demand value (default no): no (這裡填 no 或 直接回車)

下面灰色部分為DNS地址,必須手動設置為本地DNS地址,server為自動獲取DNS,但連接寬帶時始終沒有成功只好又手動輸入了上海本地的電信DNS地址才登錄成功。
DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: 202.96.209.133 (首選DNS地址,此處為上海電信DNS地址,具體請填寫你所在地的DNS地址)
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: 116.228.111.118 (備選DNS地址,此處為上海備選DNS地址,具體請百度查詢你所在地的DNS)



PASSWORD


>>> Please enter your PPPoE password: (輸入寬帶密碼)


>>> Please re-enter your PPPoE password: (再次輸入密碼)



FIREWALLING


Please choose the firewall rules to use.
Note that these rules are very basic.
You are strongly encouraged to use a more sophisticated firewall setup; however, these will provide basic security.
If you are running any servers on your machine, you must choose 'NONE' and set up firewalling yourself.
Otherwise, the firewall rules will deny access to all standard servers like Web, e-mail, ftp, etc.
If you are using SSH, the rules will block outgoing SSH connections which allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible for ensuring the security of your machine.
You are STRONGLY recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN

>>> Choose a type of firewall (0-2): 0 (0表示不開啟防火牆)


** Summary of what you entered **
Ethernet
Interface: eth0
User name: zhaiqutianshangxing
Activate-on-demand: No
Primary DNS:202.96.209.133
Secondary DNS:116.228.111.118
Firewalling:NONE

>>> Accept these settings and adjust configuration files (y/n)? y (輸入y 確認配置信息)
( 摘取天上星 )
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf (But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets (But first backing it up to /etc/ppp/pap-secrets-bak) (But first backing it up to /etc/ppp/chap-secrets-bak)

Congratulations, it should be all set up!

Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down. Type 'pppoe-status' to see the link status.


[root@zhaiqutianshangxing]# pppoe-start ( pppoe-start 開啟網絡鏈接,默認配置好參數後會自動登錄網絡)

. Connected! (連接成功,你可以 ping www.baidu.com 測試一下)

4、上網命令(用 root 權限)

撥號上網 pppoe-start
斷開上網 pppoe-stop
查看狀態 pppoe-status

Copyright © Linux教程網 All Rights Reserved