锐捷网管交换机RIP 接口附加度量值配置举例

一、组网需求
Device A、Device B、Device C和Device C之间通过RIPv2路由协议实现互联互通。
Device A到Device C的10.3.3.3/24有两条等价路径,由于Device D型号老旧,性能较低,通过增加Device A的GigabitEthernet 0/2接口度量值,使Device A去往10.3.3.3优选Device B。

二、 组网图
RIP 接口附加度量值配置组网图

三、配置要点
(1) 所有设备配置接口IP地址。
(2) 所有设备配置RIP基本功能。
(3) Device C上配置ACL,并配置offset-list在与B连接接口生效。

四、 配置步骤
(1) Device C配置ACL,匹配10.3.3.3/24路由。
Device C> enable
Device C# configure terminal
Device C(config)# access-list 1 permit 10.3.3.3 0.0.0.255

(2) Device C配置Offset-List关联ACL 1,并在GigabitEthernet 0/2上生效。
Device C(config)# router rip
Device C(config-router)# offset-list 1 out 3 gigabitEthernet 0/2

五、验证配置结果
# 检查Device A路由表。
Device A# show ip route rip
R 10.3.3.0/24 [120/5] via 192.168.14.4, 00:06:11, GigabitEthernet 0/1

六、 配置文件
Device C配置文件。
!
access-list 1 permit 10.3.3.3 0.0.0.255
!
router rip
offset-list 1 out 3 gigabitEthernet 0/2

锐捷网管交换机RIP 防止路由环路配置举例

一、组网需求
如下图,Device A、Device B和Device C通过RIP路由协议实现互联互通。
为避免路由环路,需要配置毒性逆转的水平分割和触发更新。
为提高可靠性,开启GR,并在Device A和Device B连接接口开启BFD。

二、组网图
启动触发更新配置组网图

三、 配置要点
(1) 所有设备配置接口IP地址(略)。
(2) 所有设备配置RIP基本功能。
(3) Device A和Device B启用RIP触发更新和毒性逆转。

四、配置步骤
(1) 配置所有设备配置接口IP地址(略)。
(2) 开启设备的RIP进程,并且通告各个接口的网络信息。
# Device A的配置。
Device A> enable
Device A# configure terminal
Device A(config)# router rip
Device A(config-router)# network 192.168.1.0
Device A(config-router)# network 200.1.1.0
Device A(config-router)# exit

# Device B的配置。
Device B> enable
Device B# configure terminal
Device B(config)# router rip
Device B(config-router)# network 192.168.1.0
Device B(config-router)# network 201.1.1.0
Device B(config-router)# exit

(3) 启用RIP毒性逆转与触发更新。
# Device A的配置。
Device A(config)# interface gigabitethernet 0/1
Device A(config-if-GigabitEthernet 0/1)# ip rip triggered
Device A(config-if-GigabitEthernet 0/1)# ip rip split-horizon poisoned-reverse

# Device B的配置。
Device B(config)# interface gigabitethernet 0/1
Device B(config-if-GigabitEthernet 0/1)# ip rip triggered
Device B(config-if-GigabitEthernet 0/1)# ip rip split-horizon poisoned-reverse

五、 验证配置结果
# 检查设备A、B检查RIP的数据库,对应的路由属性是永久的。
●Device A
Device A# show ip rip database
201.1.1.0/24 auto-summary
201.1.1.0/24
[1] via 192.168.12.2 GigabitEthernet 0/1 06:25 permanent

● Device B
Device B# show ip rip database
200.1.1.0/24 auto-summary
200.1.1.0/24
[1] via 192.168.12.1 GigabitEthernet 0/1 06:25 permanent

六、配置文件
● Device A的配置文件。
!
interface gigabitethernet 0/1
ip rip split-horizon poisoned-reverse
ip rip triggered
!
!
router rip
network 192.168.1.0
network 200.1.1.0
!
● Device B的配置文件。
!
interface gigabitethernet 0/1
ip rip split-horizon poisoned-reverse
ip rip triggered
!
router rip
network 192.168.1.0
network 201.1.1.0
!

七、常见错误
● 链路两端的RIP配置一致,但确启用了该功能。
● 与BFD同时启用。
● 未在同链路所有设备上启用该功能。

锐捷网管交换机建立 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表不做比较。
● 设备互联接口被设置为被动接口。

锐捷网管交换机RIP 引入外部路由举例

一、组网需求
如下图,Device B通过RIP和Device A通讯,Device B通过静态路由获取10.3.3.3路由。为了Device A能够获得10.3.3.3路由信息,在Device B上将OSPF路由协议。引入外部路由的可靠性低,设置外部缺省度量值为5。

二、组网图
RIP 引入外部路由配置组网图

三、 配置要点
(1) 配置各接口的IP地址和启动单播路由协议(略)。
(2) Device B配置静态路由。
(3) Device A和Device B配置RIP基本功能(略)。
(4) Device B配置路由重分发,设置重分发路由缺省度量值。

四、 配置步骤
(1) 配置各接口的IP地址和启动单播路由协议(略)。
(2) Device B配置去往10.3.3.3/24的静态路由,下一跳为192.168.23.3。
Device B> enable
Device B# configure terminal
Device B(config)# ip route 10.3.3.3 255.255.255.0 192.168.23.3

(3) Device A和Device B配置RIP基本功能

(4) Device B配置重分发路由缺省度量值为5。
Device B(config)# router rip
Device B(config-router)# default-metric 5
(5) Device B配置重分发静态路由至RIP。
Device B(config-router)# redistribute static

五、 验证配置结果
# Device A上检查路由表,可以查到10.3.3.0/24的RIP路由,度量值为6。
Device A# show ip route rip
R 10.3.3.0/24 [120/6] via 192.168.12.2, 00:06:11, GigabitEthernet 0/1

六、 配置文件
# Device B的配置文件。
!
ip route 10.3.3.3 255.255.255.0 192.168.23.3
!
router rip
default-metric 5
redistribute static
!

锐捷网管交换机快速重路由配置举例

一、组网需求
Device A,Device B和Device C通过静态路由实现互联,Device A默认通过Device C访问Host C。以防Device A和Device C的链路故障,配置快速重路由,在链路故障时能够快速切换至备份链路。

二、 组网图
快速重路由配置组网图
三、配置要点
● 在Device A上配置到达Host C网段的静态路由,出接口下一跳指向Device C。
● 在Device A上配置静态快速重路由,备份路由出接口下一跳指向Device B。

四、 配置步骤
(1) 配置路由器IP地址。
(2) 配置静态路由,使各主机网络互通(略)。
(3) 配置路由图,设置备份路由出接口下一跳指向Device B。
Device A> enable
Device A# configure terminal
Device A(config)# route-map fast-reroute
Device A(config-route-map)# set fast-reroute backup-interface gigabitethernet 0/2 backup-nexthop 1.1.12.2

(4) 配置静态快速充路由。
Device A(config-route-map)# exit
Device A(config)# ip fast-reroute static route-map fast-reroute

五. 验证配置结果
# 显示Device A上的主备路由。
Device A# show ip route fast-reroute
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
Status codes: m – main entry, b – backup entry, a – active entry
Gateway of last resort is no set
S 1.1.3.0 /24 [ma] via 1.1.13.3, GigabitEthernet 0/3
[b] via 1.1.12.2, GigabitEthernet 0/2

六、配置文件
●Device A的配置文件。
!
route-map fast-reroute
set fast-reroute backup-interface gigabitethernet 0/2 backup-nexthop 1.1.12.2
!
ip fast-reroute static route-map fast-reroute
!

七、常见错误
● 接口链路没有Up。
● 未配置静态路由。
● 路由图中未设置match匹配条件,或设置错误。

锐捷网管交换机静态路由联动 BFD 配置举例

1. 组网需求
通过配置静态路由Host A和Host B实现互通,其中Device A-Device B为主链路,通过配置BFD,当主链路故障时,快速切换到Device C进行通讯。

2. 组网图
静态路由联动 BFD 配置组网图

3. 配置要点
● 在Device A、Device B和Device C上配置静态路由,指定出接口/下一跳为互联接口。
● 在Device A、Device B互联接口上配置BFD会话。
● 在Device A、Device B上配置静态路由与BDF联动,检测静态路由下一跳的连通性。

四、配置步骤
(1) 配置接口IP地址。
(2) 配置静态路由实现网络互通。
# Device A的配置。
Device A> enable
Device A# configure terminal
Device A(config)# ip route 1.1.2.0 255.0.0.0 gigabitethernet 0/1 1.1.12.2
Device A(config)# ip route 1.1.2.0 255.0.0.0 gigabitethernet 0/2 1.1.13.3 40

# Device B的配置。
Device B> enable
Device B# configure terminal
Device B(config)# ip route 1.1.1.0 255.0.0.0 gigabitethernet 0/1 1.1.12.1
Device B(config)# ip route 1.1.1.0 255.0.0.0 gigabitethernet 0/2 1.1.23.3 40

# Device C的配置。
Device C> enable
Device C# configure terminal
Device C(config)# ip route 1.1.1.0 255.0.0.0 gigabitEthernet 0/0 1.1.13.1
Device C(config)# ip route 1.1.2.0 255.0.0.0 gigabitEthernet 0/1 1.1.23.2
(3) 接口下配置BFD。
# Device A的配置。
Device A(config)# interface gigabitethernet 0/1
Device A(config-if-GigabitEthernet 0/1)# bfd interval 100 min_rx 100 multiplier 3
Device A(config-if-GigabitEthernet 0/1)# exit

# Device B的配置。
Device B(config)# interface gigabitethernet 0/1
Device B(config-if-GigabitEthernet 0/1)# bfd interval 100 min_rx 100 multiplier 3
Device B(config-if-GigabitEthernet 0/1)# exit

(4) 静态路由与BFD联动。
# Device A的配置。
Device A(config)# ip route static bfd gigabitethernet 0/1 1.1.12.2
# Device B的配置。
Device B(config)# ip route static bfd gigabitethernet 0/1 1.1.12.1

五、验证配置结果
# 查看BFD邻居状态。
Device A# show bfd neighbors
OurAddr NeighAddr LD/RD RH/RS Holdown(mult) State Int
1.1.12.1 1.1.12.2 8192/0 Up 0(3 ) Up GigabitEthernet 0/1

# 检查设查看BFD邻居状态。
Device A# show ip route static bfd
S 1.1.2.0/24 via 1.1.12.2, GigabitEthernet 0/1, BFD state is Up

六、 配置文件
● Device A的配置文件。
!
interface gigabitethernet 0/1
bfd interval 50 min_rx 50 multiplier 3
!
ip route 1.1.2.0 255.0.0.0 gigabitEthernet 0/1 1.1.12.2
ip route 1.1.2.0 255.0.0.0 gigabitEthernet 0/2 1.1.13.3 40
!
ip route static bfd gigabitEthernet 0/1 1.1.12.2
!
● Device B的配置文件。
!
interface gigabitethernet 0/1
bfd interval 50 min_rx 50 multiplier 3
!
ip route 1.1.1.0 255.0.0.0 gigabitEthernet 0/1 1.1.12.1
ip route 1.1.1.0 255.0.0.0 gigabitEthernet 0/2 1.1.23.3 40
!
ip route static bfd gigabitEthernet 0/1 1.1.12.1
!
● Device C的配置文件。
!
ip route 1.1.1.0 255.0.0.0 gigabitEthernet 0/0 1.1.13.1
ip route 1.1.2.0 255.0.0.0 gigabitEthernet 0/1 1.1.23.2
!

七、 常见错误
● 接口链路没有Up。
●接口没有配置IP地址。
● 没有配置BFD会话参数。
● 没有配置静态路由。

 

 

 

锐捷网管交换机IPv4 静态路由与 Track 联动配置举例

一、组网需求
Device A和Device B通过静态路由实现Host A 1.1.1.2和Host B 1.1.2.2的互联互通,为能够及时获悉链路可达状态,使用Track与静态路由联动功能。

二、组网图
IPv4 静态路由与 Track 联动配置组网图

三、 配置要点
● 在设备各接口上配置地址。
● 在Device A、Device B上配置静态路由,指定出接口/下一跳为互联接口
●在Device A、Device B上配置静态路由与Track联动,检测静态路由下一跳的连通性。

四、 配置步骤
(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)# ip address 1.1.12.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/1)# exit

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

(2) 配置Track功能。
# Device A的配置。
Device A(config)# track 2 interface gigabitethernet 0/1 line-protocol
# Device B的配置。
Device B(config)# track 2 interface gigabitethernet 0/1 line-protocol

(3) 配置静态路由并与Track联动。
# Device A的配置。
Device A(config)# ip route 1.1.2.0 255.0.0.0 gigabitethernet 0/1 1.1.12.2 track 2
# Device B的配置。
Device B(config)# ip route 1.1.1.0 255.0.0.0 gigabitethernet 0/1 1.1.12.1 track 2

五、验证配置结果
# 查看Track 2统计信息。
Device A# show track 2
Track 2
Interface gigabitEthernet 0/1
The state is Up, delayed Down (5 secs remaining)
1 change, current state last: 300 secs
Delay up 0 secs, down 0 secs

# 查看IP路由联动Track信息与状态。
Device A# show ip route track-table
ip route 1.1.2.0 255.0.0.0 GigabitEthernet 0/1 1.1.12.2 track 2 up

六、 配置文件
● Device A的配置文件
!
interface gigabitethernet 0/1
ip address 1.1.12.1 255.255.255.0
!
track 2 interface gigabitethernet 0/1 line-protocol
!
ip route 1.1.2.0 255.0.0.0 gigabitEthernet 0/1 1.1.12.2 track 2
!
● Device B的配置文件
!
interface gigabitethernet 0/1
ip address 1.1.12.2 255.255.255.0
!
track 2 interface gigabitethernet 0/1 line-protocol
!
ip route 1.1.1.0 255.0.0.0 gigabitEthernet 0/1 1.1.12.1 track 2
!

七、常见错误
● 配置静态路由与Track联动,但未配置Track对象。

 

锐捷网管交换机IPv4 静态路由配置举例

一、组网需求
通过配置静态路由实现全网路由可达。

二、组网图
IPv4 静态路由配置组网图

三、配置要点
●在设备各接口上配置地址。
●在设备上配置静态路由。

四、配置步骤
(1) 配置各接口的IP地址。
# Device A的配置。
Device A> enable
Device A# configure terminal
Device A(config)# interface gigabitethernet 0/0
Device A(config-if-GigabitEthernet 0/0)# ip address 1.1.1.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/0)# exit
Device A(config)# interface gigabitethernet 0/2
Device A(config-if-GigabitEthernet 0/2)# ip address 1.1.12.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/2)# exit
Device A(config)# interface gigabitethernet 0/3
Device A(config-if-GigabitEthernet 0/3)# ip address 1.1.13.1 255.255.255.0
Device A(config-if-GigabitEthernet 0/3)# exit

# Device B的配置。
Device B> enable
Device B# configure terminal
Device B(config)# interface gigabitethernet 0/0
Device B(config-if-GigabitEthernet 0/0)# ip address 1.1.2.1 255.255.255.0
Device B(config-if-GigabitEthernet 0/0)# exit
Device B(config)# interface gigabitethernet 0/1
Device B(config-if-GigabitEthernet 0/1)# ip address 1.1.12.2 255.255.255.0
Device B(config-if-GigabitEthernet 0/1)# exit
Device B(config)# interface gigabitethernet 0/3
Device B(config-if-GigabitEthernet 0/3)# ip address 1.1.23.2 255.255.255.0
Device B(config-if-GigabitEthernet 0/3)# exit

# Device C的配置。
Device C> enable
Device C# configure terminal
Device C(config)# interface gigabitethernet 0/0
Device C(config-if-GigabitEthernet 0/0)# ip address 1.1.3.1 255.255.255.0
Device C(config-if-GigabitEthernet 0/0)# exit
Device C(config)# interface gigabitethernet 0/1
Device C(config-if-GigabitEthernet 0/1)# ip address 1.1.13.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)# ip address 1.1.23.3 255.255.255.0
Device C(config-if-GigabitEthernet 0/2)# exit

(2) 启动IPv4静态路由功能。
# Device A的配置。
Device A(config)# ip route 1.1.2.0 255.255.255.0 gigabitethernet 0/2 1.1.12.2
Device A(config)# ip route 1.1.3.0 255.255.255.0 gigabitethernet 0/3 1.1.13.3

# Device B的配置。
Device B(config)# ip route 1.1.1.0 255.255.255.0 gigabitethernet 0/1 1.1.12.1
Device B(config)# ip route 1.1.3.0 255.255.255.0 gigabitethernet 0/3 1.1.23.3

# Device C的配置。
Device C(config)# ip route 1.1.2.0 255.255.255.0 gigabitethernet 0/2 1.1.23.2
Device C(config)# ip route 1.1.1.0 255.255.255.0 gigabitethernet 0/1 1.1.13.1

五、验证配置结果
检查设备的路由表,确认有静态路由条目。
# Device A的路由表。
Device A# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
C 1.1.1.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.1.1/32 is local host.
S 1.1.2.0/24 [1/0] via 1.1.12.2, GigabitEthernet 0/2
S 1.1.3.0/24 [1/0] via 1.1.13.3, GigabitEthernet 0/2
C 1.1.12.0/24 is directly connected, GigabitEthernet 0/2
C 1.1.12.1/32 is local host.
C 1.1.13.0/24 is directly connected, GigabitEthernet 0/3
C 1.1.13.1/32 is local host.
# Device B的路由表。
Device B# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
S 1.1.1.0/24 [1/0] via 1.1.12.1, GigabitEthernet 0/0
C 1.1.2.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.2.1/32 is local host.
S 1.1.3.0/24 [1/0] via 1.1.23.3, GigabitEthernet 0/3
C 1.1.12.0/24 is directly connected, GigabitEthernet 0/1
C 1.1.12.2/32 is local host.
C 1.1.23.0/24 is directly connected, GigabitEthernet 0/3
C 1.1.23.2/32 is local host.

# Device C的路由表。
Device C# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
S 1.1.1.0/24 [1/0] via 1.1.13.1, GigabitEthernet 0/2
S 1.1.2.0/24 [1/0] via 1.1.23.2, GigabitEthernet 0/2
C 1.1.3.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.3.1/32 is local host.
C 1.1.13.0/24 is directly connected, GigabitEthernet 0/1
C 1.1.13.3/32 is local host.
C 1.1.23.0/24 is directly connected, GigabitEthernet 0/2
C 1.1.23.3/32 is local host.

六、 配置文件
● Device A的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.1.1 255.255.255.
!
interface gigabitethernet 0/2
ip address 1.1.12.1 255.255.255.0
!
interface gigabitethernet 0/3
ip address 1.1.13.1 255.255.255.0
!
ip route 1.1.2.0 255.255.255.0 GigabitEthernet 0/2 1.1.12.2
ip route 1.1.3.0 255.255.255.0 GigabitEthernet 0/3 1.1.13.3
!
● Device B的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.2.1 255.255.255.0
!
interface gigabitethernet 0/1
ip address 1.1.12.2 255.255.255.0
!
interface gigabitethernet 0/3
ip address 1.1.23.2 255.255.255.0
!
ip route 1.1.1.0 255.255.255.0 GigabitEthernet 0/1 1.1.12.1
ip route 1.1.3.0 255.255.255.0 GigabitEthernet 0/3 1.1.23.3
!
● Device C的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.3.1 255.255.255.0
!
interface gigabitethernet 0/1
ip address 1.1.13.3 255.255.255.0
!
interface gigabitethernet 0/2
ip address 1.1.23.3 255.255.255.0
!
ip route 1.1.2.0 255.255.255.0 GigabitEthernet 0/2 1.1.23.2
ip route 1.1.1.0 255.255.255.0 GigabitEthernet 0/1 1.1.13.1
!

七、 常见错误
● 接口链路没有Up。
●接口没有配置地址。

锐捷网管交换机DHCP Snooping 基本功能配置举例

一、 组网需求
DHCP客户端用户可以通过合法DHCP服务器动态获取IP地址。

二、组网图
DHCP Snooping 基本功能配置组网图

三、配置要点
●在接入设备Device上开启DHCP Snooping功能。
●将上连口GigabitEthernet 0/1设置为TRUST口。

四、 配置步骤
# 配置Device。
Device> enable
Device# configure terminal
Device(config)# ip dhcp snooping
Device(config)# interface gigabitethernet 0/1
Device(config-if-GigabitEthernet 0/1)# ip dhcp snooping trust

五、验证配置结果
# 查看Device的DHCP Snooping配置情况,关注点为TRUST口是否正确。
Device# show ip dhcp snooping
Switch DHCP snooping status : ENABLE
DHCP snooping verify hardware address status : DISABLE
DHCP snooping database write-delay time : 0 seconds
DHCP snooping option 82 status : DISABLE
DHCP snooping Support bootp bind status : DISABLE
Interface Trusted Rate limit (pps)
———————— ——- —————-
GigabitEthernet 0/1 YES unlimited
# 查看Device生成的表项信息。
Device# show ip dhcp snooping binding
Total number of bindings: 1
NO. MACADDRESS IPADDRESS LEASE(SEC) TYPE VLAN INTERFACE
1 0013.2049.9014 172.16.1.2 86207 DHCP-Snooping 1 GigabitEthernet 0/1

六、配置文件
Device的配置文件
hostname Device
!
ip dhcp snooping
!
interface GigabitEthernet 0/1
ip dhcp snooping trust
!
end

七、 常见错误
● 没有将上连口设置为DHCP TRUST口。
●在上连口上配置了其他的接入安全选项,导致配置DHCP TRUST口失败。

锐捷网管交换机DHCP 客户端基本功能配置举例

一、组网需求
如图所示,Device A的接口GigabitEthernet 0/1通过DHCP协议,从Device B(DHCP服务器)获取IP地址和DNS服务器地址20.1.1.1/24。
DHCP 客户端基本功能配置组网图

二、 配置要点
● 开启Device A接口GigabitEthernet 0/1上的DHCP客户端功能。
● 开启Device B的DHCP服务器功能,并按要求配置地址池参数。

三、配置步骤
(1) 配置Device A
# 配置在接口GigabitEthernet 0/1上启用DHCP Client服务。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1)# ip address dhcp

(2) 配置Device B
# 启用DHCP Server服务。
DeviceB> enable
DeviceB# configure terminal
DeviceB(config)# service dhcp

# 配置与客户端连接的接口IP地址。
DeviceB(config)# interface gigabitethernet 0/1
DeviceB(config-if-GigabitEthernet 0/1)# ip address 20.1.1.2 255.255.255.0
DeviceB(config-if-GigabitEthernet 0/1)# exit

# 配置与DNS服务器连接的接口IP地址。
DeviceB(config)# interface gigabitethernet 0/2
DeviceB(config-if-GigabitEthernet 0/2)# ip address 20.1.2.2 255.255.255.0
DeviceB(config-if-GigabitEthernet 0/2)# exit

# 配置动态地址池。
DeviceB(config)# ip dhcp pool User
DeviceB(dhcp-config)# network 20.1.1.0 255.255.255.0
DeviceB(dhcp-config)# dns-server 20.1.2.1
DeviceB(dhcp-config)# exit

# 配置排除地址。
DeviceB(config)# ip dhcp excluded-address 20.1.1.2

(3) 配置DNS Server
# 配置DNS Server的IP地址为20.1.2.1/24。

四、验证配置结果
# 在Device B上通过show dhcp lease查看接口获取IP地址信息。
DeviceB# show dhcp lease
Temp IP addr: 20.1.1.1 for peer on Interface: GigabitEthernet 0/1
Temp sub net mask: 255.255.255.0
DHCP Lease server: 20.1.1.2, state: 7 Bound
DHCP transaction id: ca811331
Lease: 14400 secs, Renewal: 7200 secs, Rebind: 12600 secs
Next timer fires after: 4916 secs
Retry count: 0 Client-ID: 0158696cc59347
# 在Device A上通过show hosts查看接口获取DNS服务器信息。
DeviceA# show hosts
Name servers are:
20.1.2.1 dynamic from DHCP
Host type Address TTL(sec)

五、 配置文件
● Device A的配置文件
hostname DeviceA
!
interface gigabitethernet 0/1
ip address dhcp
!
● Device B的配置文件
hostname DeviceB
!
service dhcp
ip dhcp excluded-address 20.1.1.2
!
interface gigabitethernet 0/1
ip address 20.1.1.2 255.255.255.0
!
interface gigabitethernet 0/2
ip address 20.1.2.2 255.255.255.0
!
ip dhcp pool User
network 20.1.1.0 255.255.255.0
dns-server 20.1.2.1
!

ICP备案号:晋ICP备18007549号-1
站长微信:15534641008