首页 > 代码库 > G口与S口的区别
G口与S口的区别
拓扑图:
RT1配置:
<RT1>sys
System View: return to User View with Ctrl+Z.
[RT1]int g0/0/0
[RT1-GigabitEthernet0/0/0]ip add 1.1.1.1 24
[RT1-GigabitEthernet0/0/0]ping 1.1.1.1
[RT1-GigabitEthernet0/0/0]int s0/1/0
[RT1-Serial0/1/0]ip add 2.2.2.2 24
[RT1-Serial0/1/0]ping 2.2.2.2
RT2配置:
<RT2>sys
System View: return to User View with Ctrl+Z.
[RT2]
[RT2]int g0/0/0
[RT2-GigabitEthernet0/0/0]ip add 2.2.2.3 24
[RT2-GigabitEthernet0/0/0]int s0/1/0
[RT2-Serial0/1/0]ip add 1.1.1.2 24
[RT2-Serial0/1/0]
%Sep 28 21:58:41:859 2014 RT2 IFNET/5/PROTOCOL_UPDOWN: Protocol PPP IPCP on the interface Serial0/1/0 is UP.
[RT2-Serial0/1/0]
对RT1和RT2配环回地址:
[RT1-Serial0/1/0]quit
[RT1]int loo1
[RT1-LoopBack1]ip add 3.3.3.3 32
[RT2-Serial0/1/0]quit
[RT2]int loo1
[RT2-LoopBack1]ip add 4.4.4.4 32
[RT2-LoopBack1]
关闭RT1和RT2的S口:
[RT1-LoopBack1]int s0/1/0
[RT1-Serial0/1/0]shut
对RT1和RT2的G口配静态路由:
[RT1-Serial0/1/0]quit
[RT1]ip route-static 4.4.4.4 32 2.2.2.3
[RT1]
[RT2-LoopBack1]quit
[RT2]ip route-static 3.3.3.3 32 1.1.1.1
[RT2]
关闭RT1和RT2的G口,开S口:
[RT1]undo ip route-static 4.4.4.4 32
[RT1]int s0/1/0
[RT1-Serial0/1/0]undo shut
[RT1-Serial0/1/0]int g0/0/0
[RT1-GigabitEthernet0/0/0]shut
[RT2]undo ip route-static 3.3.3.3 32
对RT1和RT2的S口配静态路由:
[RT1-GigabitEthernet0/0/0]quit
[RT1]ip route-static 4.4.4.4 32 1.1.1.2
[RT2]ip route-static 3.3.3.3 32 2.2.2.2
总结:
S口支持的链路协议为PPP,PPP是一种点到点协议,它支持地址协商功能,所以不存在同一网段,ip地址不同还是可以ping通的。
G口与S口的区别