锐捷网管交换机建立 RIP 路由域配置举例

一、组网需求
Device A、Device B和Device C通过RIPv2路由协议实现互联互通。
为节约设备性能,3台设备所有接口默认配置成被动接口,只有与RIP邻居直连的接口关闭被动接口。

二、 组网图
RIP 路由域配置组网图

三、配置要点

● 所有设备配置接口IP地址。
● 所有设备配置RIP基本功能。

四、配置步骤
(1) 配置各接口的IP地址和启动单播路由协议。
# Device A的配置。
Device A> enable
Device A# configure terminal
Device A(config)# interface gigabitethernet 0/1
Device A(config-if-GigabitEthernet 0/1)# no switchport
Device A(config-if-GigabitEthernet 0/1)# ip address 110.11.2.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/1)# exit
Device A(config)# interface gigabitethernet 0/2
Device A(config-if-GigabitEthernet 0/2)# no switchport
Device A(config-if-GigabitEthernet 0/2)# ip address 155.10.1.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/2)# exit

# Device B的配置。
Device B> enable
Device B# configure terminal
Device B(config)# interface gigabitethernet 0/1
Device B(config-if-GigabitEthernet 0/1)# no switchport
Device B(config-if-GigabitEthernet 0/1)# ip address 110.11.2.2 255.255.255.0
Device B(config-if-GigabitEthernet 0/1)# exit
Device B(config)# interface gigabitethernet 0/2
Device B(config-if-GigabitEthernet 0/2)# no switchport
Device B(config-if-GigabitEthernet 0/2)# ip address 196.38.165.1 255.255.255.0
Device B(config-if-GigabitEthernet 0/2)# exit

# Device C的配置。
Device C> enable
Device C# configure terminal
Device C(config)# interface gigabitethernet 0/1
Device C(config-if-GigabitEthernet 0/1)# no switchport
Device C(config-if-GigabitEthernet 0/1)# ip address 110.11.2.3 255.255.255.0
Device C(config-if-GigabitEthernet 0/1)# exit
Device C(config)# interface gigabitethernet 0/2
Device C(config-if-GigabitEthernet 0/2)# no switchport
Device C(config-if-GigabitEthernet 0/2)# ip address 117.102.0.1 255.255.0.0
Device C(config-if-GigabitEthernet 0/2)# exit

(2) 配置设备配置RIP基本功能。除了RIP邻居接口,其余接口都配置成被动接口。
# Device A的配置。
Device A(config)# router rip
Device A(config-router)# version 2
Device A(config-router)# network 0.0.0.0 255.255.255.255
Device A(config-router)# passive-interface default
Device A(config-router)# no passive-interface gigabitethernet 0/1

# Device B的配置。
Device B(config)# router rip
Device B(config-router)# version 2
Device B(config-router)# network 0.0.0.0 255.255.255.255
Device B(config-router)# passive-interface default
Device B(config-router)# no passive-interface gigabitethernet 0/1

# Device C的配置。
Device C(config)# router rip
Device C(config-router)# version 2
Device C(config-router)# no auto-summary
Device C(config-router)# network 0.0.0.0 255.255.255.255
Device C(config-router)# passive-interface default
Device C(config-router)# no passive-interface gigabitethernet 0/1

五、验证配置结果
# 检查A、B和C上的IP路由表,应看到RIP学到了远端网络的路由。
●Device A
Device A# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.1/32 is local host.
R 117.0.0.0/8 [120/1] via 110.11.2.2, 00:00:47, GigabitEthernet 0/1
C 155.10.1.0/24 is directly connected, GigabitEthernet 0/2
C 155.10.1.1/32 is local host.
C 192.168.217.0/24 is directly connected, VLAN 1
C 192.168.217.233/32 is local host.
R 196.38.165.0/24 [120/1] via 110.11.2.3, 00:19:18, GigabitEthernet 0/1

●Device B
Device B# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.2/32 is local host.
R 155.10.0.0/16 [120/1] via 110.11.2.1, 00:15:21, GigabitEthernet 0/1
C 196.38.165.0/24 is directly connected, GigabitEthernet 0/2
C 196.38.165.1/32 is local host.
R 117.0.0.0/8 [120/1] via 110.11.2.2, 00:00:47, GigabitEthernet 0/1

●Device C
Device C# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.3/32 is local host.
C 117.102.0.0/16 is directly connected, GigabitEthernet 0/2
C 117.102.0.1/32 is local host.
R 155.10.0.0/16 [120/1] via 110.11.2.1, 00:20:55, GigabitEthernet 0/1
R 196.38.165.0/24 [120/1] via 110.11.2.3, 00:19:18, GigabitEthernet 0/1

六、配置文件
● 设备A的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.1 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 155.10.1.1 255.255.255.0
!
router rip
version 2
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
!
●设备B的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.2 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 196.38.165.1 255.255.255.0
!
router rip
version 2
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
!
● 设备C的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.3 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 117.102.0.1 255.255.255.0
!
router rip
version 2
no auto-summary
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
!
七、常见错误
●接口上未配置IPv4地址。
● 某台设备上没有定义RIP版本,或RIP版本号与其他设备不一致。
● network命令配置的地址范围未覆盖某接口。
● network命令参数IP地址比较比特位配置错误。0表示精确匹配,1表不做比较。
● 设备互联接口被设置为被动接口。

退出移动版
ICP备案号:晋ICP备18007549号-1
站长微信:15534641008