一、PPP(點對點協議(Point to Point Protocol))
1、PPP協議功能
1) 簡單:在同一條物理鏈路上進行點對點的數據傳輸,對數據鏈路層的幀不進行糾錯,不需要序號,不需要流量控制。
2) 封裝成幀:加入幀界定符。
3) 透明性:字節填充法。
4) 多種網絡層協議:在同一條物理鏈路上同時支持多種網絡層協議(如IP和IPX等)的運行。
5) 多種鏈路類型:PPP必須能夠在多種類型的鏈路上運行,例如串行或並行鏈路。
6) 差錯檢測:接收方收到一個幀后進行CRC檢驗,若正確就收下這個幀,反之則丟棄。
7) 檢測連接狀態:自動檢測鏈路是否處於正常工作狀態。
2、PPP協議組成
1) 提供一個將IP數據報封裝到串行鏈路的方法。IP數據報在PPP幀中就是信息部分,長度受最大傳送單元MTU的限制。PPP支持異步鏈路(無奇偶校驗的8比特數據)和面向比特的同步鏈路。
2) 鏈路控制協議LCP(Link Control Protocol)當線路不再需要時,挑出這些線路,測試它們,商議選擇,並仔細地再次釋放鏈路控制協議。
3) 一套網絡控制協議NCP(Network Control Protocol)其中每一個協議支持不同的網絡層協議,如IP、OSI的網絡層等。
4) 認證協議最常用的包括口令驗證協議PAP(Password Authentication Protocol)和挑戰握手驗證協議CHAP(Challenge-Handshake Authentication Protocol)。
3、PPP協議的六個階段
1) 鏈路不可用階段: 初始階段
2) 鏈路建立階段: LCP協商,(協商認證方式等)
3) 驗證階段: PAP/CHAP驗證
4) 網絡層協議階段:**NCP協商
5) PPP會話維持階段: 維持PPP會話, 定時發送Echo Request報文,並等待Echo Reply報文
6) 網絡終止階段: 終止PPP會話,回到鏈路不可用階段。
4、配置實例
R1:
[R1]local-user 123456 class network [R1-luser-network-123456]password simple 123456 [R1-luser-network-123456]service-type ppp [R1]int s1/0 [R1-Serial1/0]ppp authentication-mode chap 啟用認證
R2:
[R2]int s1/0 [R2-Serial1/0]ppp chap password simple 123456 發送密碼 [R2-Serial1/0]ppp chap user 123456 發送用戶名
二、三層鏈路聚合
1、配置實例
R配置
[R]int Route-Aggregation 1 創建三層聚合接口組1 [R]interface range g0/1 g0/2 [R-if-range]port link-mode route 修改兩個端口為三層模式 [R-if-range]port link-aggregation group 1 加入聚合端口組1 [R]int Route-Aggregation 1 [R-Route-Aggregation1]ip address 12.1.1.1 24 為聚合端口組配置ip地址 [R]display link-aggregation verbose 查看聚合口配置信息 Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing Port: A -- Auto Port Status: S -- Selected, U -- Unselected, I -- Individual Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation, D -- Synchronization, E -- Collecting, F -- Distributing, G -- Defaulted, H -- Expired Aggregate Interface: Route-Aggregation1 Aggregation Mode: Static Loadsharing Type: Shar Port Status Priority Oper-Key -------------------------------------------------------------------------------- GE0/1 S 32768 1 GE0/2 S 32768 1
sw配置
[SW]int Route-Aggregation 1 [SW]int range g1/0/1 g1/0/2 [SW-GigabitEthernet1/0/2]port link-mode route [SW-GigabitEthernet1/0/1]port link-aggregation group 1 [SW]int Route-Aggregation 1 [SW-Route-Aggregation1]ip address 12.1.1.2 24 <SW>display link-aggregation verbose Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing Port: A -- Auto Port Status: S -- Selected, U -- Unselected, I -- Individual Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation, D -- Synchronization, E -- Collecting, F -- Distributing, G -- Defaulted, H -- Expired Aggregate Interface: Route-Aggregation1 Aggregation Mode: Static Loadsharing Type: Shar Port Status Priority Oper-Key -------------------------------------------------------------------------------- GE1/0/1 S 32768 1 GE1/0/2 S 32768 1
三、VRRP虛擬網關冗余協議
1、拓撲圖
R1:
[R1]int g0/1 [R1-GigabitEthernet0/1]ip address 192.168.1.252 24 [R1-GigabitEthernet0/1]vrrp vrid 1 virtual-ip 192.168.1.254 虛擬一個IP地址,做網關 [R1-GigabitEthernet0/1]vrrp vrid 1 priority 105 修改優先級,保證為master [R1-GigabitEthernet0/1]display vrrp IPv4 virtual router information: Running mode : Standard Total number of virtual routers : 1 Interface VRID State Running Adver Auth Virtual pri timer(cs) type IP --------------------------------------------------------------------- GE0/1 1 Master 105 100 None 192.168.1.254
R2:
[R2]int g0/2 [R2-GigabitEthernet0/2]ip address 192.168.1.253 24 [R2-GigabitEthernet0/2]vrrp vrid 1 virtual-ip 192.168.1.254 共同虛擬一個網關 [R2]display vrrp IPv4 virtual router information: Running mode : Standard Total number of virtual routers : 1 Interface VRID State Running Adver Auth Virtual pri timer(cs) type IP --------------------------------------------------------------------- GE0/2 1 Backup 100 100 None 192.168.1.254
PC:
[PC]int g0/0 [PC-GigabitEthernet0/0]ip address 192.168.1.2 24 [PC]ip route-static 0.0.0.0 0 192.168.1.254 <PC>ping 192.168.1.254 Ping 192.168.1.254 (192.168.1.254): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.1.254: icmp_seq=0 ttl=255 time=1.000 ms 56 bytes from 192.168.1.254: icmp_seq=1 ttl=255 time=1.000 ms
2、VRRP:通過下行鏈路,每隔兩秒發送VRRP檢測包,如果發現主端斷掉,馬上完成切換。