Router> enable Router# configure terminal Router(config)# interface ethernet 0 Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# exit Router# ping 192.168.1.2 ! 驗證連通性
**常見錯誤**:忘記 `no shutdown` 導致介面 Admin Down,新手最易忽略。
Router(config)# interface serial 0 Router(config-if)# ip address 10.0.0.1 255.255.255.252 Router(config-if)# encapsulation x25 Router(config-if)# x25 address 1234567890123 ! 13 碼 X.25 位址,由郵電局提供 Router(config-if)# x25 map ip 10.0.0.2 9876543210987 broadcast Router(config-if)# x25 htc 100 ! 最高雙向通道數,依郵電局實際提供值設定 Router(config-if)# x25 nvc 50 ! 虛擬電路數,不可超過郵電局提供值 Router(config-if)# no shutdown Router(config-if)# exit
| 現象 | 可能原因 | 對策 |
|---|---|---|
| Ping 自身 S0 IP 通,Ping 對端 X.25 IP 不通 | 1. 本端 X.25 位址錯誤 (長度須 13 碼) 2. Map IP/X.25 位址錯誤 3. 對端配置錯誤 4. 路由配置錯誤 | 重新核對郵電局提供參數、雙端對照 map 設定、檢查路由表 |
| 通訊正常但有丟包 | 1. 線路品質差 / 接觸不良 2. htc/nvc 設定超過郵電局實際提供值 | 1. 檢查纜線、RJ45、DSU/CSU 2. **htc/nvc 絕不可超過郵電局實際值**,寧小勿大 |
! HDLC (預設) interface serial 0 ip address 10.0.0.1 255.255.255.252 no shutdown ! PPP + CHAP interface serial 0 ip address 10.0.0.1 255.255.255.252 encapsulation ppp ppp authentication chap ppp chap hostname R1 ppp chap password Secret@123 clock rate 64000 ! DCE 端必須 no shutdown ! Frame Relay interface serial 0 ip address 10.0.0.1 255.255.255.252 encapsulation frame-relay frame-relay map ip 10.0.0.2 100 broadcast frame-relay lmi-type ansi no shutdown
show interfaces serial 0 show controllers serial 0 show x25 vc show x25 map debug x25 events debug serial packet debug ppp negotiation undebug all