Juniper SRX210 ADSL的設定



Juniper SRX210 ADSL的設定



ADSL,全名Asymmetric Digital Subscriber Line。中譯非對稱數位用戶線路,或作非對稱數位用戶回路Asymmetric Digital Subscriber Loop)。

ADSL因為上行(從用戶到電信服務提供商方向,如上傳動作)和下行(從電信服務提供商到用戶的方向,如下載動作)頻寬不對稱(即上行和下行的速率不相同)因此稱為非對稱數位用戶線路。它採用分頻多路復用技術把普通的電話線分成了電話、上行和下行三個相對獨立的頻道,從而避免了相互之間的干擾。通常ADSL在不影響正常電話通訊的情況下可以提供最高3.5Mbps的上行速度和最高24Mbps的下行速度。

設備
ADSL是一種異步傳輸模式(ATM)。
在電信服務提供商端,需要將每條開通ADSL業務的電話線路連接在數位用戶線路訪問多路復用器(DSLAM)上。而在用戶端,用戶需要使用一個ADSL終端(和傳統的數據機(Modem)類似)來連接電話線路。由於ADSL使用高頻訊號,所以在兩端還都要使用ADSL訊號分離器(splitter)將ADSL數據訊號和普通音訊電話訊號分離出來,避免打電話的時候出現噪音干擾。
通常的ADSL終端有一個電話Line-In,一個乙太網口,有些終端集成了ADSL訊號分離器,還提供一個連接的Phone接口。
傳輸標準
由於受到傳輸高頻訊號的限制,ADSL需要電信服務提供商端接入設備和用戶終端之間的距離不能超過5公里,也就是用戶的電話線連到電話局的距離不能超過5公里
ADSL設備在傳輸中需要遵循以下標準之一:
  • ITU-T G.992.1G.dmt
    • G.dmt:全速率,下行8Mbps,上行896Kbps
  • ITU-T G.992.2G.lite
    • G.lite:下行1.5Mbps,上行512Kbps
  • ITU-T G.994.1G.hs
    • 可變位元率(VBR
  • ANSI T1.413 Issue #2
    • 下行8Mbps,上行896Kbps
還有一些更快更新的標準,但是目前還很少有電信服務提供商使用:
  • ITU G.992.3/4
    • ADSL2下行12Mbps,上行1.0Mbps
  • ITU G.992.3/4
    • Annex J ADSL2下行12Mbps,上行3.5Mbps
  • ITU G.992.5
    • ADSL2+ 下行24Mbps,上行1.0Mbps
  • ITU G.992.5
    • Annex M ADSL2+ 下行24Mbps,上行3.5Mbps
ADSL2+還可以支持線路bonding的方式,也就是給終端用戶提供多個線路,總帶寬是單個線路帶寬的累計.支持bonding方式的應用很少,技術方面詳見G.998.xG.bonding
當電信服務提供商的設備端和用戶終端之間距離小於1.3公里的時候,還可以使用速率更高的VDSL,它的速率可以達到下行55.2Mbps,上行19.2Mbps
網路登錄標準
APPLE通常提供三種網路登錄方式:
  • 橋接,直接提供靜態IP
  • PPPoA,基於ATM的點對點協議
  • PPPoE,基於乙太網的點對點協議
後兩種通常不提供靜態IP,而是動態的給用戶分配網路地址。
(PS:上述資料來自維基百科)

 

網路上中華電信ADSL參數設定如下:
編輯 VCI 3334 這一組, (更改之前,請先抄下自己的原設定.有的人是33,有的人是34)
ATM PVC Configuration
VPI0
VCI33
Service CategoryUBR Without PCR
OR  Service CategoryUBR

VPIVirtual path identifier (VPI) is the virtual path between two points in an ATM network. Its valid value is between 0 and 255. Enter the correct VPI provided by your ISP.
VCIVirtual channel identifier (VCI) is the virtual channel between two points in an ATM network. Its valid value is between 1 and 65535. Enter the correct VCI provided by your ISP.
Service CategorySelect the Quality of Service types for this Virtual Circuit. The ATM QoS types include CBR (Constant Bit Rate), VBR (Variable Bit Rate) and UBR (Unspecified Bit Rate).

Connection Type
PPP over Ethernet(PPPoE)
Encapsulation Mode
LLC/SNAP-BRIDGING

Encapsulation mode used for the ASDL connection. Contactyour ISP or carrier for the appropriate setting.
VC MUX: Virtual Circuit Multiplexing.
LLC/SNAP: Logical Link Control/Subnetwork AccessProtocol.
PPP Username and Password
ppp usernametest-adsl
ppp passwordXXXXXXXXXX
Authentication MethodAuto

密碼驗證有PAP或是CHAP為兩種不同的密碼驗證方式
PAP(Password Authentication Protocol) 使用明碼驗證
CHAP(Challenge Handshake Authentication Protocol) 使用 MD5 的加密驗證

申請hinet網路服務後,營業處應該都會發一組用戶號碼(HN號碼)用戶密碼(HN密碼)
用於PPPoE驗證連線使用一般光世代浮動用戶帳號格式為:
用戶號碼@hinet.net   (固定ip用戶則為@ip.hinet.net)


SRX210本身並沒有ADSL介面,必須要外接SRX-MP-1ADSL2-A ADSL2擴充卡才行,圖片如下:






Juniper SRX210 ADSL參數設定如下:

set interfaces at-1/0/0 mtu 1350
set interfaces at-1/0/0 encapsulation ethernet-over-atm
set interfaces at-1/0/0 atm-options vpi 0
set interfaces at-1/0/0 dsl-options operating-mode auto
set interfaces at-1/0/0 unit 0 encapsulation ppp-over-ether-over-atm-llc
set interfaces at-1/0/0 unit 0 vci 0.33

interfaces {
    at-1/0/0 {
        mtu 1492;
        encapsulation ethernet-over-atm;
        atm-options {
            vpi 0;
        }
        dsl-options {
            operating-mode auto;
        }
        unit 0 {
            encapsulation ppp-over-ether-over-atm-llc;
            vci 0.33;
        }
    }
}




WebUI設定示範如下:






















You can configure the following properties for the ADSL and SHDSL interfaces:
• Physical properties
• Logical properties

You can configure the following physical properties for the interface:
Encapsulation type—for example, ethernet-over-atm:
atm-pvc—ATM permanent virtual circuits is the default encapsulation for
ATM-over-ADSL and ATM-over-SHDSL interfaces.
For PPP over ATM (PPPoA)-over-ADSL and over-SHDSL interfaces, use this type
of encapsulation.
ethernet-over-atm—Ethernet over ATM encapsulation.
For PPP over Ethernet (PPPoE) over ATM-over-ADSL and ATM-over-SHDSLinterfaces
that carry IPv4 traffic, use this type of encapsulation.

You can configure the following logical properties for the interface:
The following encapsulations are supported on the ATM-over-ADSL andATM-over-SHDSL interfaces that use inet (IP) protocols only:
atm-vc-mux—Use ATM virtual circuit multiplex encapsulation.
atm-nlpid—Use ATM network layer protocol identifier (NLPID) encapsulation.
atm-cisco-nlpid—Use Cisco NLPID encapsulation.
ether-over-atm-llc—For interfaces that carry IPv4 traffic, use Ethernet over LLC
encapsulation. You cannot configure multipoint interfaces if you use this type of
encapsulation.
The following encapsulations are supported on the ATM-over-ADSL orATM-over-SHDSL for PPP-over-ATM (PPPoA) interfaces only.
atm-ppp-llc—AAL5 logical link control (LLC) encapsulation.
atm-ppp-vc-mux—Use AAL5 multiplex encapsulation.
Other encapsulation types supported on the ATM-over-ADSL and ATM-over-SHDSL
interfaces are:
ppp-over-ether-over-atm-llc—Use PPP over Ethernet over ATM LLC encapsulation.
When you use this encapsulation type, you cannot configure the interface address.
Instead you configure the interface address on the PPP interface.
atm-snap—Use ATM subnetwork attachment point (SNAP) encapsulation.



上述的參數設定好之後,我們就可以開始設定 PPPoE 撥接上網了(必要條件)
若您的ADSL使用PPPoE 撥接上網,則請您直接跳到下一段 “SRX 設定 PPPoE 撥接上網


SRX 設定 ADSL 使用固定IP上網
若您的ADSL並非使用PPPoE撥接上網,而是擁有固定IP的用戶,則您的設定會簡單許多,只要再執行下列命令即可:
set interfaces at-1/0/0 unit 0 address 10.2.3.33/28
set routing-options static route 0.0.0.0/0 qualified-next-hop at-1/0/0.0 metric 1
set security zones security-zone untrust interfaces at-1/0/0.0

您也可以將上述CLI命令整理起來,全部複製並一次全部貼到CLI命令列上。
deactivate interface at-1/0/0
delete interfaces at-1/0/0
set interfaces at-1/0/0 mtu 1492
set interfaces at-1/0/0 encapsulation ethernet-over-atm
set interfaces at-1/0/0 atm-options vpi 0
set interfaces at-1/0/0 dsl-options operating-mode auto
set interfaces at-1/0/0 unit 0 encapsulation ppp-over-ether-over-atm-llc
set interfaces at-1/0/0 unit 0 vci 0.33
set interfaces at-1/0/0 unit 0 address 10.2.3.33/28
set routing-options static route 0.0.0.0/0 qualified-next-hop at-1/0/0.0 metric 1
set security zones security-zone untrust interfaces at-1/0/0.0
commit



SRX 設定 PPPoE 撥接上網
Juniper SRX JUNOSSetup Wizard(設定精靈)JUNIPER SRX JUNOS使用上較為人性化的一部分,若您使用過JUNIPER SSG SCREENOS系列產品之後,再使用JUNIPER SRX系列產品時,您會覺得SSG系列產品在使用上更為方便與易懂,比SRX這根難啃的骨頭親民許多,而Setup Wizard(設定精靈)則可以拉近JUNIPER SRX系列產品與你我之間的距離。
Setup Wizard(設定精靈)只有在WebUI(J-Web)使用介面才有,而且JUNOS版本10.X11.X12.1R12.1X其功能略有不同,但是較新的版本功能更為強大好用,我們在登入WebUI後,可以在Configure > Tasks 選單中找到它,如下圖:



在開始之前您可以先參考下列VDSL的連結的設定方式,跟我們接下來的步驟一樣,只是比ADSL更好設定,因為不需要設定界面參數即可完成設定。

以下我們將PPPoE綁定在at-1/0/0.0介面上,進行Setup Wizard作業。
我們從Configure > Tasks > Configure PPPoE 開始執行進行Setup Wizard作業。如下圖所示:





































執行過setup wizard之後的設定:
    at-1/0/0 {
        encapsulation ethernet-over-atm;
        atm-options {
            vpi 0;
        }
        unit 0 {
            encapsulation ppp-over-ether-over-atm-llc;
            vci 0.33;
        }
    }
    pp0 {
        unit 0 {
            apply-macro Seednet-ADSL;
            ppp-options {
                chap {
                    default-chap-secret "$9$T3CuREyMWx/CyKM8dVmfT";
                    local-name seednet;
                    no-rfc2486;
                    passive;
                }
                pap {
                    local-name seednet;
                    no-rfc2486;
                    local-password "$9$fz/t1IcKvLn/clKMN-qmf";
                    passive;
                }
            }
            pppoe-options {
                underlying-interface at-1/0/0.0;
            }
            family inet {
                negotiate-address;
            }
        }
    }
routing-options {
    static {
        route 0.0.0.0/0 {
            qualified-next-hop pp0.0 {
                metric 1;
            }
        }
    }
}
    zones {
        security-zone untrust {
            interfaces {
                pp0.0;
            }
        }
    }
不知道是不是因為沒有實體線路測試,所以at-0/0/0.0介面(ADSL2擴充卡)設定少了一些,相信若有實體線路測試的話結果會更明確些。若有好心的大大已經成功的話,能麻煩您將成功的設定檔(中華電信用戶)EMAIL給我,讓我驗證下,萬分感謝您!  taiwankid168@gmail.com
set interfaces at-1/0/0 encapsulation ethernet-over-atm
set interfaces at-1/0/0 atm-options vpi 0
set interfaces at-1/0/0 unit 0 encapsulation ppp-over-ether-over-atm-llc
set interfaces at-1/0/0 unit 0 vci 0.33
set interfaces pp0 unit 0 apply-macro Seednet-ADSL
set interfaces pp0 unit 0 ppp-options chap default-chap-secret seednet
set interfaces pp0 unit 0 ppp-options chap local-name seednet
set interfaces pp0 unit 0 ppp-options chap no-rfc2486
set interfaces pp0 unit 0 ppp-options chap passive
set interfaces pp0 unit 0 ppp-options pap local-name seednet
set interfaces pp0 unit 0 ppp-options pap no-rfc2486
set interfaces pp0 unit 0 ppp-options pap local-password seednet
set interfaces pp0 unit 0 ppp-options pap passive
set interfaces pp0 unit 0 pppoe-options underlying-interface at-1/0/0.0
set interfaces pp0 unit 0 family inet negotiate-address
set routing-options static route 0.0.0.0/0 qualified-next-hop pp0.0 metric 1
set security zones security-zone untrust interfaces pp0.0






本人在使用SRX VDSL的時候發現一個嚴重的問題,VDSL會斷線,往往重新拔插VDSL電話線後就可以恢復連線,上網找問題發現不少人在下載BT時小烏龜也容易產生斷線問題,而我的問題則是發生在下載MEGA免空時,經過至少20分鐘後才會斷線,分析原因,是因為本人的網路頻寬只有2M/64K(我申請的是最基本的ADSL頻寬,但是因為我住的大廈沒拉ADSL線路,只有VDSL線路,所以中華電信包商就給我VDSL數據機來連線),而下載MEGA免空時會將頻寬給擠爆,當您PING 168.95.1.1 -t 時,會發現特別容易掉封包,如下圖:


也因此而導至下載大檔案時會斷線,但是只發生在下載MEGA免空時,下載ftp就沒有這個問題,檢查syslog發現斷線時會有以下訊息:
srx210 /kernel: pp0.0 down: no keepalive.
srx210 /kernel: pp0.0, KA interval=10, KA downCnt=3, KA sent=925, KA repliesRx=828, KA cpNotSent=0
Juniper原廠網站搜尋發現我們可以更改keepalive參數設定:
set interfaces pp0 unit 0 keepalives interval 10
set interfaces pp0 unit 0 keepalives up-count 1
set interfaces pp0 unit 0 keepalives down-count 125
commit
我們可以透過執行下列指令來查詢:
root@srx210# show interfaces pp0
..  Keepalive settings: Interval 10 seconds, Up-count 1, Down-count 3  (左側數據皆為預設值)
更改後的數據如下:
root@srx210# show interfaces pp0
..  Keepalive settings: Interval 10 seconds, Up-count 1, Down-count 125
當我們將斷線計數值加大後,測試就沒有再發生斷線的問題了。

以下為keepalive參數說明:
On interfaces configured with Cisco HDLC or PPP encapsulation, you can include the following three keepalive statements; note that Frame Relay encapsulation is not affected by these statements:
  • interval seconds—The time in seconds between successive keepalive requests. The range is from 1 second through 32767 seconds, with a default of 10 seconds.
  • down-count number—The number of keepalive packets a destination must fail to receive before the network takes a link down. The range is from 1 through 255, with a default of 3.
  • up-count number—The number of keepalive packets a destination must receive to change a link’s status from down to up. The range is from 1 through 255, with a default of 1.
在配置了Cisco HDLCPPP封裝的接口上,可以包含以下三個keepalive語句;請注意,幀中繼封裝不受以下語句的影響:
interval seconds間隔秒數 -連續 keepalive 請求之間的時間 (以秒為單位)。該範圍是從1秒到32767, 預設為10秒。
down-count number斷線計數 - keepalive 無法接收失敗資料包數達到斷線計數值時,就關閉網路連線。該範圍從1 255, 預設值為3
up-count number連線計數 -當接收的keepalive 資料包的數量達到連線計數值時, 就將連線的狀態從斷線中更改為連線中。該範圍從1 255, 預設值為1

雖然解決了斷線的問題,但是當我們查詢是卻發現了下面的問題:
root@srx210> show interfaces pp0
  Keepalive settings: Interval 10 seconds, Up-count 1, Down-count 3
  Keepalive: Input: 0 , Output: 4072 (00:00:02 ago)
送出4072keepalive封包,卻完全沒有收到回訊,可能是因為對端網路設備並非配置了Cisco HDLCPPP封裝的端口的因素,於是嘗試用另一種方式來解決:
set interfaces pp0 unit 0 pppoe-options idle-timeout 0
set interfaces pp0 unit 0 pppoe-options auto-reconnect 120
set interfaces pp0 unit 0 no-keepalives
commit

root@srx210> show interfaces pp0
  Keepalive: Input: 0 (never), Output: disabled (never)
經過測試,上述方法也能達到避免因為keepalive 設定因素而導至網路斷線的問題發生。
上述之方法適合於使用PPPoE撥接上網的USERS






在ge-0/0/0.0界面執行過setup wizard之後,自行整理移植到at-0/0/0.0的設定:
    at-1/0/0 {
        encapsulation ethernet-over-atm;
        atm-options {
            vpi 0;
        }
        unit 0 {
            encapsulation ppp-over-ether-over-atm-llc;
            vci 0.33;
        }
    }
    pp0 {
        unit 0 {
            apply-macro Seednet-ADSL;
            ppp-options {
                chap {
                    default-chap-secret "$9$T3CuREyMWx/CyKM8dVmfT";
                    local-name seednet;
                    no-rfc2486;
                    passive;
                }
                pap {
                    local-name seednet;
                    no-rfc2486;
                    local-password "$9$fz/t1IcKvLn/clKMN-qmf";
                    passive;
                }
            }
            pppoe-options {
                underlying-interface at-1/0/0.0;
            }
            family inet {
                negotiate-address;
            }
        }
    }
routing-options {
    static {
        route 0.0.0.0/0 {
            qualified-next-hop pp0.0 {
                metric 1;
            }
        }
    }
}
    zones {
        security-zone untrust {
            interfaces {
                pp0.0;
            }
        }
    }

這個網誌中的熱門文章

如何測試網路連線--網路斷線了怎麼辦?

筆記電腦刷BIOS失敗無法開機—用CH341A編程器重刷BIOS教學!

INTEL XTU使用教學以及對筆電應具備的XTU設定概念