锐捷网管交换机基于 SNMPv3 的 SNMP 基本功能配置举例

一、组网需求
网络管理站和被管理的网络设备通过网络连接,在网络管理站上,通过SNMP网络管理器,访问网络设备上的管理信息数据库,以及接收来自网络设备主动发出的消息,来对网络设备进行管理和监控。
● 网络工作站(NMS)基于用户的认证加密模式对网络设备(Agent)进行管理。
● 网络设备能够控制用户访问MIB对象的操作权限。
●网络设备能够主动向网管工作站发送验证加密的消息。

二、 组网图
SNMPv3 基本功能配置组网图
三、配置要点
● 配置MIB视图和SNMP用户组。
● 配置SNMP用户。
● 配置SNMP主机。
● 配置Agent的IP地址。

三、 配置步骤
# 创建一个名称为view1点MIB视图,包含关联的MIB对象为1.3.6.1.2.1.1;再创建一个MIB视图“view2”,包含关联的MIB对象(1.3.6.1.2.1.1.4.0)。
Device> enable
Device# configure terminal
Device(config)# snmp-server view view1 1.3.6.1.2.1.1 include

# 创建一个名称为view2点MIB视图,包含关联的MIB对象为1.3.6.1.2.1.1.4.0。
Device(config)# snmp-server view view2 1.3.6.1.2.1.1.4.0 include

# 创建一个名称为g1的SNMP用户组,版本号为v3,安全级别为priv协议的认证加密模式,设置视图view1为可读视图,view2视图为可写视图。
Device(config)# snmp-server group g1 v3 priv read view1 write view2

# 配置SNMP用户。创建名称为user1的用户,属于组g1,选择版本号为v3,配置认证方式为MD5协议认证,认证密码为123,加密方式为DES56加密协议,加密密码为321。
Device(config)# snmp-server user user1 g1 v3 auth md5 123 priv des56 321

# 配置SNMP主机:配置主机地址为192.168.3.2,SNMP版本号为3,安全级别为priv的认证加密模式,关联对应的用户名为user1。
Device(config)# snmp-server host 192.168.3.2 traps version 3 priv user1

# 配置Agent主动向NMS发送Trap消息。
Device(config)# snmp-server enable traps

# 配置Agent的IP地址。配置接口GigabitEthernet 0/1的地址为192.168.3.1/24。
Device(config)# interface gigabitEthernet 0/1
Device(config-if-gigabitEthernet 0/1)# ip address 192.168.3.1 255.255.255.0
Device(config-if-gigabitEthernet 0/1)# exit

四、验证配置结果
# 通过ping命令验证Agent与NMS三层可达。
Device# ping 192.168.3.2
Sending 5, 100-byte ICMP Echoes to 192.168.3.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms.
# 通过show snmp user命令查看SNMP用户。
Device# show snmp user
User name: user1
Engine ID: 800013110300d0f8221120
storage-type: permanent active
Security level: auth priv
Auth protocol: MD5
Priv protocol: DES
Group-name: g1
# 通过show snmp view命令查看SNMP视图。
Device# show snmp view
view1(include) 1.3.6.1.2.1.1
view2(include) 1.3.6.1.2.1.1.4.0
default(include) 1.3.6.1
# 通过show snmp group命令查看SNMP组。
Device# show snmp group
groupname: g1
securityModel: v3
securityLevel:authPriv
readview: view1
writeview: view2
notifyview:
# 通过show snmp host命令查看用户配置的主机信息。
Device# show snmp host
Notification host: 192.168.3.2
udp-port: 162
type: trap
user: user1
security model: v3 authPriv
# 安装MIB-Browser查询。在IP Address中输入设备的IP地址:192.168.3.1,在UserName中输入“user1”,在Security Level中选择“AuthPriv”,在AuthPassWord中输入“123”,在AuthProtocol中选择“MD5”,在PrivPassWord中输入“321”。
点击add item按钮,选择要查询的MIB的具体管理单元,比如System。点击Start按钮,便开始对网络设备进行MIB的查询了,具体的查询结果见下图中对话框的最下面的窗口:
选择要查询的MIB的具体管理单元

五、 配置文件
Agent的配置文件
interface GigabitEthernet 0/1
ip address 192.168.2.1 255.255.255.0
!
snmp-server view view1 1.3.6.1.2.1.1 include
snmp-server view view2 1.3.6.1.2.1.1.4.0 include
snmp-server user user1 g1 v3 encrypted auth md5 DE8E9D1158A057A69EF73D1C12C51CC5 priv des56
C767B705F9B261E6D359D4BFBDAF9CF4
snmp-server group g1 v3 priv read view1 write view2
snmp-server host 192.168.3.2 traps version 3 priv user1
snmp-server enable traps
!
end

 

锐捷网管交换机基于 SNMPv2c 的基本功能配置举例

一、组网需求
如下图:通过SNMP网络管理器,来对网络设备进行管理和监控。

二、 组网图
SNMPv2 基本功能配置组网图

 

三、 配置步骤
# 开启SNMP代理功能。
Device> enable
Device# configure terminal
Device(config)# enable service snmp-agent

# 配置名称为comm_v1的读写团体。
Device(config)# snmp-server community comm_v2 rw

# 配置Agent的IP地址。配置接口GigabitEthernet 0/1的地址为192.168.3.1/24。
Device(config)# interface gigabitEthernet 0/1
Device(config-if-gigabitEthernet 0/1)# ip address 192.168.3.1 255.255.255.0
Device(config-if-gigabitEthernet 0/1)# exit

四、验证配置结果
# 通过ping命令验证Agent与NMS三层可达。
Device# ping 192.168.3.2
Sending 5, 100-byte ICMP Echoes to 192.168.3.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms.

# 通过show service命令查看SNMP代理功能是否开启。
Device# show service
snmp-agent : enabled
ssh-server : disabled
telnet-server : enabled

五、 配置文件
Agent的配置文件
interface GigabitEthernet 0/1
ip address 192.168.2.1 255.255.255.0
!
snmp-server community comm_v2 rw
!
end

 

海康威视门禁设备设置开门超时报警,关门后不报警的操作方法

一、开门超时报警设置:

1、设备接线。若要设置开门超时报警,门锁和门磁都需要接线(

2、设置门磁类型和超时时间。在访问控制-高级配置-设备参数,选择对应的门,设置门磁类型和门开超时时间。开门超时报警设置

3、设置联动报警。点击访问控制-联动配置,选择设备,点击添加,事件类型为门事件,门磁打开超时。联动目标根据具体需求选择,如联动报警输出。设置联动报警

 

二、关门后不报警设置:

点击4200客户端-访问控制-联动配置,选中设备,点添加,事件类型选择门磁正常关关门后不报警设置

 

三、效果验证:
可以在事件里面查看是否有对应的事件产生,如果有事件并且配置没问题的情况下,会有类似下面的事件可以查询到。
效果验证

锐捷网管交换机基于时间段的 ACL 规则配置举例

一、组网需求
如下图:配置基于时间段的ACL规则,只允许研发部门在每天的12:00到13:30访问Internet。

二、 组网图
基于时间段的 ACL 规则配置组网图

三、配置要点
●Device A配置时间段,并添加每天12:00到13:30的时间段表项。
●Device A配置IP标准ACL并添加规则,包括:
○ 添加允许源IP网段地址为10.1.1.0/24的规则,关联的时间段为access-internet。
○ 添加禁止源IP网段地址为10.1.1.0/24的规则。表明时间段之外都不允许访问Internet。
○ 添加允许除研发网段地址外,其他所有网段地址的规则。
● Device A将ACL应用在连接研发部接口的入方向上。

四、 配置步骤
(1) 配置时间区。
# Device A配置时间段。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# time-range access-internet
DeviceA(config-time-range)# periodic daily 12:00 to 13:30
DeviceA(config-time-range)# exit
(2) 配置IP标准ACL并添加访问规则。
# Device A配置IP标准ACL并添加访问规则。
DeviceA(config)# ip access-list standard ip_std_internet_acl
DeviceA(config-std-nacl)# permit 10.1.1.0 0.0.0.255 time-range access-internet
DeviceA(config-std-nacl)# deny 10.1.1.0 0.0.0.255
DeviceA(config-std-nacl)# permit any
DeviceA(config-std-nacl)# exit
(3) 将IP标准ACL应用到接口上。
# Device A将ACL应用在连接研发部接口的入方向上。
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1)# ip access-group ip_std_internet_acl in

五、 验证配置结果
● 检查Device A设备ACL配置命令是否正确。
DeviceA# show time-range
time-range entry: access-internet (inactive)
periodic Daily 12:00 to 13:30
DeviceA# show access-lists
ip access-list standard ip_std_internet_acl
10 permit 10.1.1.0 0.0.0.255 time-range access-internet (inactive)
20 deny 10.1.1.0 0.0.0.255
30 permit any
DeviceA# show access-group
ip access-group ip_std_internet_acl in
Applied On interface GigabitEthernet 0/1
# 在时间段生效期内(12:00至13:30),从研发部分内的某台PC机访问百度主页,确认可以访问。
# 在时间段失效期(12:00至13:30时段外),从研发部分内的某台PC机访问百度主页,确认不能访问。

六、 配置文件
● DeviceA的配置文件
hostname DeviceA
!
ip access-list standard ip_std_internet_acl
10 permit 10.1.1.0 0.0.0.255 time-range access-internet
20 deny 10.1.1.0 0.0.0.255
30 permit any
!
time-range access-internet
periodic daily 12:00 to 13:30
!
interface GigabitEthernet 0/1
no switchport
ip access-group ip_std_internet_acl in
ip address 10.1.1.1 255.255.255.0
!

 

锐捷网管交换机IP 扩展 ACL 配置举例

一、组网需求
如下图:Device A(VLAN 1)、Device B(VLAN 2)和Device C(VLAN 3)直连Device D,Device D是所有主机的网关。
需求1:VLAN2与VLAN3之间不可以Ping通,VLAN1与VLAN2可以Ping通,VLAN1与VLAN3可以Ping通。
需求2:VLAN1与VLAN2的DHCP报文互相不可达,其他正常通信。需求3:VLAN1不能通过Telnet或者SSH访问VLAN3,其他正常通信。

二、 组网图
IP 扩展 ACL 配置组网图

三、配置要点
● Device D配置IP扩展ACL并添加访问规则,过滤UDP端口号67或者68可以实现需求2。Device C配置IP扩展ACL并添加访问规则,过滤TCP端口23和22可以实现需求3。
●Device D将IP扩展ACL分别应用在VLAN1接口、VLAN2接口和VLAN3接口上。Device C将IP扩展ACL应用在与Device D相线路上。

四、 配置步骤
(1) 配置所有设备接口的IP地址(略)。
(2) 配置IP扩展ACL并添加访问规则。
# Device D配置IP扩展ACL并添加访问规则。
DeviceD> enable
DeviceD# configure terminal
DeviceD(config)# ip access-list extended inter_vlan_access1
DeviceD(config-ext-nacl)# deny udp any eq bootps any eq bootpc
DeviceD(config-ext-nacl)# deny udp any eq bootpc any eq bootps
DeviceD(config-ext-nacl)# remark 拒绝 DHCP 报文
DeviceD(config-ext-nacl)# permit ip any any
DeviceD(config-ext-nacl)# remark 允许其他报文通信
DeviceD(config-ext-nacl)# exit
DeviceD(config)# ip access-list extended inter_vlan_access2
DeviceD(config-ext-nacl)# deny ip 192.168.2.0 0.0.0.255 192.168.3.0 0.0.0.255
DeviceD(config-ext-nacl)# remark 拒绝 VLNN2 和 VLAN3 之间互 ping
DeviceD(config-ext-nacl)# deny udp any eq bootpc any eq bootps
DeviceD(config-ext-nacl)# deny udp any eq bootps any eq bootpc
DeviceD(config-ext-nacl)# remark 拒绝 DHCP 报文
DeviceD(config-ext-nacl)# permit ip any any
DeviceD(config-ext-nacl)# remark 允许其他报文通信
DeviceD(config-ext-nacl)# exit
DeviceD(config)# ip access-list extended inter_vlan_access3
DeviceD(config-ext-nacl)# deny ip 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255
DeviceD(config-ext-nacl)# remark 拒绝 VLNN3 和 VLAN2 之间互 ping
DeviceD(config-ext-nacl)# permit ip any any
DeviceD(config-ext-nacl)# remark 允许其他报文通信
DeviceD(config-ext-nacl)# exit

# Device C配置IP扩展ACL并添加访问规则。
DeviceC> enable
DeviceC# configure terminal
DeviceC(config)# ip access-list extended access_deny
DeviceC(config-ext-nacl)# deny tcp 192.168.1.0 0.0.0.255 eq telnet any eq telnet
DeviceC(config-ext-nacl)# remark 拒绝 VLAN1 通过 Telnet 访问 VLAN 3
DeviceC(config-ext-nacl)# deny tcp 192.168.1.0 0.0.0.255 eq 22 any eq 22
DeviceC(config-ext-nacl)# remark 拒绝 VLAN1 通过 SSH 访问 VLAN 3
DeviceC(config-ext-nacl)# exit

(3) 应用IP扩展ACL。
# Device D将IP扩展ACL应用到对应接口上。
DeviceD(config)# interface vlan 1
DeviceD(config-if-VLAN 1)# ip access-group inter_vlan_access1 in
DeviceD(config-if-VLAN 1)# exit
DeviceD(config)# interface vlan 2
DeviceD(config-if-VLAN 2)# ip access-group inter_vlan_access2 in
DeviceD(config-if-VLAN 2)# exit
DeviceD(config)# interface vlan 3
DeviceD(config-if-VLAN 3)# ip access-group inter_vlan_access3 in
DeviceD(config-if-VLAN 3)# exit

# Device C将IP扩展ACL应用到与Device D相连线路上。
DeviceC(config)# line vty 0
DeviceC(config-line)# access-class access_deny in
DeviceC(config-line)# exit

五、验证配置结果
(1) 验证连通性。
# VLAN 1与VLAN 2之间可以Ping通,VLAN 1与VLAN 3之间可以Ping通。
DeviceA# ping 192.168.2.2
Sending 5, 100-byte ICMP Echoes to 192.168.2.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/8/10 ms
DeviceA#
DeviceA# ping 192.168.3.2
Sending 5, 100-byte ICMP Echoes to 192.168.3.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/8/10 ms

# VLAN 2与VLAN 3之间不可以Ping通。
DeviceB# ping 192.168.3.2
Sending 5, 100-byte ICMP Echoes to 192.168.3.2, timeout is 2 seconds:
< press Ctrl+C to break >
…..
Success rate is 0 percent (0/5)

(2) VLAN 1不能通过Telnet访问VLAN 3。
DeviceA# ping 192.168.3.2
Sending 5, 100-byte ICMP Echoes to 192.168.3.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/8/10 ms
DeviceA#
DeviceA# telnet 192.168.3.2
Trying 192.168.3.2, 23…
% Destination unreachable; gateway or host down

六、 配置文件
●Device D的配置文件
hostname DeviceD
!
vlan 1
!
vlan 2
!
vlan 3
!
ip access-list extended inter_vlan_access1
10 deny udp any eq bootps any eq bootpc
20 deny udp any eq bootpc any eq bootps
remark 拒绝 DHCP 报文
30 permit ip any any
remark 允许其他报文通信
!
ip access-list extended inter_vlan_access2
10 deny ip 192.168.2.0 0.0.0.255 192.168.3.0 0.0.0.255
remark 拒绝 VLNN2 和 VLAN3 之间互 ping
20 deny udp any eq bootpc any eq bootps
30 deny udp any eq bootps any eq bootpc
remark 拒绝 DHCP 报文
40 permit ip any any
remark 允许其他报文通信
!
ip access-list extended inter_vlan_access3
10 deny ip 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255
remark 拒绝 VLNN3 和 VLAN2 之间互 ping
20 permit ip any any
remark 允许其他报文通信
!
interface GigabitEthernet 1/0
switchport access vlan 1
description link_to_DeviceA
!
interface GigabitEthernet 1/1
switchport access vlan 2
description link_to_DeviceB
!
interface GigabitEthernet 1/2
switchport access vlan 3
description link_to_DeviceC
!
interface VLAN 1
ip access-group inter_vlan_access1 in
ip address 192.168.1.1 255.255.255.0
!
interface VLAN 2
ip access-group inter_vlan_access2 in
ip address 192.168.2.1 255.255.255.0
!
interface VLAN 3
ip access-group inter_vlan_access3 in
ip address 192.168.3.1 255.255.255.0
!

● Device A的配置文件
hostname DeviceA
!
interface GigabitEthernet 0/1
ip address 192.168.1.2 255.255.255.0
!

● Device B的配置文件
hostname DeviceB
!
interface GigabitEthernet 0/1
ip address 192.168.2.2 255.255.255.0
!

● Device C的配置文件
hostname DeviceC
!
ip access-list extended access_deny
10 deny tcp 192.168.1.0 0.0.0.255 eq telnet any eq telnet
remark 拒绝 VLAN1 通过 Telnet 访问 VLAN 3
20 deny tcp 192.168.1.0 0.0.0.255 eq 22 any eq 22
remark 拒绝 VLAN1 通过 SSH 访问 VLAN 3
!
interface GigabitEthernet 0/1
ip address 192.168.3.2 255.255.255.0
!
line vty 0
access-class access_deny in
login
password abcdef
!

 

锐捷网管交换机OSPF虚连接配置举例

一、组网需求
如下图:Area 2没有和Area 0直接连接,为保证网络中OSPF运行正常,在Device B和Device C之间配置虚链路。

二、 组网图
虚连接配置组网图

三、配置要点
● 所 有设备配置接口IP地址。
● 所有设备配置OSPF基本功能。
● 在Device B、C上配置虚链路。

四、 配置步骤
(1) 配置各接口的IP地址和OSPF路由协议。
(2) 在Device B、C上配置虚链路。
# Device B的配置。
Device B> enable
Device B# configure terminal
Device B(config)# router ospf 1
Device B(config-router)# area 1 virtual-link 192.168.23.3

# Device C的配置。
Device C> enable
Device C# configure terminal
Device C(config)# router ospf 1
Device C(config-router)# area 1 virtual-link 192.168.12.2

五、验证配置结果
# 检查Device A上使用show ip ospf database能学习到区域2的路由。
Device A# show ip ospf database
OSPF Router with ID (192.168.12.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.12.1 192.168.12.1 1025 0x80000002 0x00292E 1
192.168.12.2 192.168.12.2 3 0x80000004 0x00DA5E 2
192.168.23.3 192.168.23.3 7 (DNA) 0x80000001 0x001328 0
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.12.2 192.168.12.2 1031 0x80000001 0x00CE8E
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.23.0 192.168.12.2 820 0x80000001 0x0077CC
192.168.23.0 192.168.23.3 7 (DNA) 0x80000001 0x002414
192.168.34.0 192.168.23.3 7 (DNA) 0x80000001 0x00AA82

六、 配置文件
● Device B的配置文件。
!
router ospf 1
area 1 virtual-link 192.168.23.3
!
● Device C的配置文件。
!
router ospf 1
area 1 virtual-link 192.168.12.2
!

 

锐捷网管交换机伪链路功能配置举例

一、组网需求
如下图:两个不同站点通过MPLS骨干网交互VPN路由,同时这两个站点间又假设了一条“后门链路”,其目的为了确保在MPLS骨干网发生故障时,两个站点的信息交互仍然可以通过这条备份链路正常交互。

二、 组网图
伪链路配置组网图

三、配置要点
●  在SITEA上配置和PE1、SITEB站点相连的接口运行OSPF协议,其中和SITEB站点是通过后门链路运行OSPF协议,配置接口OSPF Cost值。
● 在SITEB上配置和PE2、SITEA站点相连的接口运行OSPF协议,其中和SITEA站点是通过备份链路运行OSPF协议,配置接口的OSPF的Cost值。
●  在PE1上配置Loopback接口,创建一个VRF:VPN A,定义RD值和RT值,并把VRF和对应的接口关联,连接CE的接口关联VRF;配置VRF的环回口,用来建立伪链路,配置BGP协议,和PE2建立MP-IBGP会话,通过OSPF协议和CE交互路由,和PE2上的OSPF实例建立伪链路,配置骨干网MPLS信令,打开公网口的MPLS能力,配置骨干网路由协议。
●  在PE2上配置Loopback接口,创建一个VRF:VPN A,定义RD值和RT值,并把VRF和对应的接口关联,连接CE的接口关联VRF,配置VRF的环回口,用来建立伪链路;配置BGP协议,和PE1建立MP-IBGP会话,通过OSPF协议和CE交互VPN路由,配置和PE1建立伪链路;配置骨干网MPLS信令,打开公网口的MPLS能力,配置骨干网路由协议。
●  在P1上配置骨干网MPLS信令,打开接口MPLS能力,配置骨干网路由协议。

四、 配置步骤
(1) SITEA上的配置。
# 配置接口IP地址。
SITEA> enable
SITEA# configure terminal
SITEA(config)# interface gigabitethernet 1/0
SITEA(config-GigabitEthernet 1/0)# ip address 192.168.10.2 255.255.255.0
SITEA(config-GigabitEthernet 1/0)# ip ospf cost 1
SITEA(config-GigabitEthernet 1/0)# exit
SITEA(config)# interface gigabitethernet 1/1
SITEA(config-GigabitEthernet 1/1)# ip address 192.168.20.1 255.255.255.0
SITEA(config-GigabitEthernet 1/1)# ip ospf cost 200
SITEA(config-GigabitEthernet 1/1)# exit

# OSPF通告接口网络。
SITEA(config)# router ospf 10
SITEA(config-router)# network 192.168.10.0 255.255.255.0 area 0
SITEA(config-router)# network 192.168.20.0 255.255.255.0 area 0

(2) SITEB上的配置。
# 配置接口IP地址。
SITEB> enable
SITEB# configure terminal
SITEB(config)# interface gigabitethernet 1/0
SITEB(config-GigabitEthernet 1/0)# ip address 192.168.30.2 255.255.255.0
SITEB(config-GigabitEthernet 1/0)# ip ospf cost 1
SITEB(config-GigabitEthernet 1/0)# exit
SITEB(config)# interface gigabitethernet 1/1
SITEB(config-GigabitEthernet 1/1)# ip address 192.168.20.2 255.255.255.0
SITEB(config-GigabitEthernet 1/1)# ip ospf cost 200
SITEB(config-GigabitEthernet 1/1)# exit

# OSPF通告接口网络。
SITEB(config)# router ospf 10
SITEB(config-router)# network 192.168.30.0 255.255.255.0 area 0
SITEB(config-router)# network 192.168.20.0 255.255.255.0 area 0

(3) PE1上的配置。
# 配置环回口0。
PE1> enable
PE1# configure terminal
PE1(config)# interface loopback 0
PE1(config-Loopback 0)# ip address 172.168.0.1 255.255.255.255
PE1(config-Loopback 0)# exit

# 创建VRF VPNA,并定义其RD和RT属性值。
PE1(config)# ip vrf VPNA
PE1(config-vrf)# rd 1:100
PE1(config-vrf)# route-target both 1:100
PE1(config-vrf)# exit

# 配置接口IP,并将VRF和对应接口关联。
PE1(config)# interface gigabitethernet 1/2
PE1(config-GigabitEthernet 1/2)# ip vrf forwarding VPNA
PE1(config-GigabitEthernet 1/2)# ip address 192.168.10.1 255.255.255.0
PE1(config-GigabitEthernet 1/2)# exit
PE1(config)# interface loopback 10
PE1(config-Loopback 10)# ip vrf forwarding VPNA
PE1(config-Loopback 10)# ip address 192.168.0.1 255.255.255.255
PE1(config-Loopback 10)# exit

# 配置BGP协议,和PE2建立MP-IBGP会话。
PE1(config)# router bgp 1
PE1(config-router)# neighbor 172.168.0.2 remote-as 1
PE1(config-router)# neighbor 172.168.0.2 update-source loopback 0
PE1(config-router)# address-family vpnv4
PE1(config-router-af)# neighbor 172.168.0.2 activate
PE1(config-router-af)# exit
PE1(config-router)# exit

# 配置和PE2上的OSPF实例建立伪链路。
PE1(config)# router ospf 10 vrf VPNA
PE1(config-router)# network 192.168.10.0 255.255.255.0 area 0
PE1(config-router)# redistribute bgp subnets
PE1(config-router)# area 0 sham-link 192.168.0.1 192.168.0.2
PE1(config-router)# exit

# 配置BGP重分发OSPF、直连路由。
PE1(config)# router bgp 1
PE1(config-router)# address-family ipv4 vrf VPNA
PE1(config-router-af)# redistribute ospf 10
PE1(config-router-af)# redistribute connected
PE1(config-router-af)# exit
PE1(config-router)# exit

# 配置骨干网MPLS信令,打开公网口的MPLS能力。
PE1(config)# mpls ip
PE1(config)# mpls router ldp
PE1(config-mpls-router)# ldp router-id interface loopback 0 force
PE1(config-mpls-router)# exit
PE1(config)# interface gigabitethernet 1/1
PE1(config-GigabitEthernet 1/1)# ip address 172.168.10.1 255.255.255.0
PE1(config-GigabitEthernet 1/1)# label-switching
PE1(config-GigabitEthernet 1/1)# mpls ip
PE1(config-GigabitEthernet 1/1)# exit

# OSPF通告接口网络。
PE1(config)# router ospf 1
PE1(config-router)# network 172.168.10.0 0.0.0.255 area 0
PE1(config-router)# network 172.168.0.1 0.0.0.0 area 0

(4) PE2上的配置。
# 配置环回口0。
PE2> enable
PE2# configure terminal
PE2(config)# interface loopback 0
PE2(config-Loopback 0)# ip address 172.168.0.2 255.255.255.255
PE2(config-Loopback 0)# exit

# 创建VRF VPNA,并定义其RD和RT属性值。
PE2(config)# ip vrf VPNA
PE2(config-vrf)# rd 1:100
PE2(config-vrf)# route-target both 1:100
PE2(config-vrf)# exit

# 配置接口IP,并将VRF和对应接口关联。
PE2(config)# interface gigabitethernet 1/2
PE2(config-GigabitEthernet 1/2)# ip vrf forwarding VPNA
PE2(config-GigabitEthernet 1/2)# ip address 192.168.30.1 255.255.255.0
PE2(config-GigabitEthernet 1/2)# exit
PE2(config)# interface loopback 10
PE2(config-Loopback 10)# ip vrf forwarding VPNA
PE2(config-Loopback 10)# ip address 192.168.0.2 255.255.255.255
PE2(config-Loopback 10)# exit

# 配置BGP协议,和PE2建立MP-IBGP会话。
PE2(config)# router bgp 1
PE2(config-router)# neighbor 172.168.0.1 remote-as 1
PE2(config-router)# neighbor 172.168.0.1 update-source loopback 0
PE2(config-router)# address-family vpnv4
PE2(config-router-af)# neighbor 172.168.0.1 activate
PE2(config-router-af)# exit
PE2(config-router)# exit

# 配置和PE2上的OSPF实例建立伪链路。
PE2(config)# router ospf 10 vrf VPNA
PE2(config-router)# network 192.168.30.0 255.255.255.0 area 0
PE2(config-router)# redistribute bgp subnets
PE2(config-router)# area 0 sham-link 192.168.0.2 192.168.0.1
PE2(config-router)# exit

# 配置BGP重分发OSPF、直连路由。
PE2(config)# router bgp 1
PE2(config-router)# address-family ipv4 vrf VPNA
PE2(config-router-af)# redistribute ospf 10
PE2(config-router-af)# redistribute connected
PE2(config-router-af)# exit

# 配置骨干网MPLS信令,打开公网口的MPLS能力。
PE2(config)# mpls ip
PE2(config)# mpls router ldp
PE2(config-mpls-router)# ldp router-id interface loopback 0 force
PE2(config-mpls-router)# exit
PE2(config)# interface gigabitethernet 1/1
PE2(config-GigabitEthernet 1/1)# ip address 172.168.40.2 255.255.255.0
PE2(config-GigabitEthernet 1/1)# label-switching
PE2(config-GigabitEthernet 1/1)# mpls ip
PE2(config-GigabitEthernet 1/1)# exit

# OSPF通告接口网络。
PE2(config)# router ospf 1
PE2(config-router)# network 172.168.40.0 0.0.0.255 area 0
PE2(config-router)# network 172.168.0.2 0.0.0.0 area 0

(5) P1上的配置。
# P1配置环回口0。
P1> enable
P1# configure terminal
P1(config)# interface loopback 0
P1(config-Loopback 0)# ip address 172.168.0.3 255.255.255.255
P1(config-Loopback 0)# exit

# OSPF基础配置。
P1(config)# router ospf 1
P1(config-router)# network 172.168.40.0 0.0.0.255 area 0
P1(config-router)# network 172.168.10.0 0.0.0.255 area 0
P1(config-router)# network 172.168.0.3 0.0.0.0 area 0
P1(config-router)# exit

# 在P1上配置骨干网MPLS信令,打开接口MPLS能力。
P1(config)# interface gigabitethernet 1/0
P1(config-GigabitEthernet 1/0)# ip address 172.168.10.2 255.255.255.0
P1(config-GigabitEthernet 1/0)# mpls ip
P1(config-GigabitEthernet 1/0)# label-switch
P1(config-GigabitEthernet 1/0)# exit
P1(config)# interface gigabitethernet 1/1
P1(config-GigabitEthernet 1/1)# ip address 172.168.40.1 255.255.255.0
P1(config-GigabitEthernet 1/1)# mpls ip
P1(config-GigabitEthernet 1/1)# label-switch
P1(config-GigabitEthernet 1/1)# exit
P1(config)# mpls ip
P1(config)# mpls router ldp
PE2(config-mpls-router)# ldp router-id interface loopback 0 force
PE2(config-mpls-router)# exit

五、验证配置结果
(1) PE1的配置验证。
# 检查PE1上存在OSPF伪链路路由。
PE1# show ip ospf 10 sham-links
Sham Link SLINK0 to address 192.168.0.2 is up
Area 0.0.0.0 source address 192.168.0.1, Cost: 1
Output interface is GigabitEthernet 1/1
Nexthop address 172.16.40.2
Transmit Delay is 1 sec, State Point-To-Point,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:01
Adjacency state Full

# 检查PE1的OSPF邻居。
PE1# show ip ospf 10 neighbor
OSPF process 10, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.0.2 1 Full/ – – 00:00:34 192.168.0.2 SLINK0

# 检查PE1 VRF路由。
PE1# show ip route vrf VPNA
Routing Table: VPNA
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 192.168.10.0/24 is directly connected, GigabitEthernet 1/2
O 192.168.20.0/24 [110/101] via 192.168.1.2, 00:56:23, GigabitEthernet 1/2
O 192.168.30.0/24 [110/2] via 172.168.0.2, 00:00:36
O 192.168.40.0/24 [110/2] via 172.168.0.2, 00:00:36

(2) PE2的配置验证。
# 检查PE1上存在OSPF 伪链路路由。
PE2# show ip ospf 10 sham-links
Sham Link SLINK0 to address 192.168.0.1 is up
Area 0.0.0.0 source address 192.168.0.2, Cost: 1
Output interface is GigabitEthernet 1/1
Nexthop address 172.16.10.1
Transmit Delay is 1 sec, State Point-To-Point,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:01
Adjacency state Full

# 检查PE2的OSPF邻居。
PE2# show ip ospf 10 neighbor
OSPF process 10, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.0.1 1 Full/ – – 00:00:34 192.168.0.1 SLINK0

# 检查PE2 VRF路由。
PE2# show ip route vrf VPNA
Routing Table: VPNA
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
O 192.168.10.0/24 [110/2] via 172.168.0.1, 00:00:36
O 192.168.20.0/24 [110/2] via 172.168.0.1, 00:00:36
C 192.168.30.0/24 is directly connected, GigabitEthernet 1/2
O 192.168.40.0/24 [110/101] via 192.168.30.2, 00:56:23, GigabitEthernet 1/2

六、 配置文件
● SITEA的配置文件。
!
interface gigabitethernet 1/0
ip address 192.168.10.2 255.255.255.0
ip ospf cost 1
!
interface gigabitethernet 1/1
ip address 192.168.20.1 255.255.255.0
ip ospf cost 200
!
router ospf 10
network 192.168.10.0 255.255.255.0 area 0
network 192.168.20.0 255.255.255.0 area 0
!
●SITEB的配置文件。
!
interface gigabitethernet 1/0
ip address 192.168.30.2 255.255.255.0
ip ospf cost 1
!
interface gigabitethernet 1/1
ip address 192.168.20.2 255.255.255.0
ip ospf cost 200
!
router ospf 10
network 192.168.30.0 255.255.255.0 area 0
network 192.168.20.0 255.255.255.0 area 0
!
● PE1的配置文件。
!
ip vrf VPNA
rd 1:100
route-target both 1:100
!
interface gigabitethernet 1/1
ip address 172.168.10.1 255.255.255.0
label-switching
mpls ip
!
interface gigabitethernet 1/2
ip vrf forwarding VPNA
ip address 192.168.10.1 255.255.255.0
interface loopback 0
ip address 172.168.0.1 255.255.255.255
!
interface loopback 10
ip vrf forwarding VPNA
ip address 192.168.0.1 255.255.255.255
!
router bgp 1
neighbor 172.168.0.2 remote-as 1
neighbor 172.168.0.2 update-source loopback 0
address-family vpnv4
neighbor 172.168.0.2 activate
address-family ipv4 vrf VPNA
redistribute ospf 10
redistribute connected
!
router ospf 1
network 172.168.10.0 0.0.0.255 area 0
network 172.168.0.1 0.0.0.0 area 0
!
router ospf 10 vrf VPNA
network 192.168.10.0 255.255.255.0 area 0
redistribute bgp subnets
area 0 sham-link 192.168.0.1 192.168.0.2
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!
●PE2的配置文件。
!
ip vrf VPNA
rd 1:100
route-target both 1:100
!
interface gigabitethernet 1/1
ip address 172.168.40.2 255.255.255.0
label-switching
mpls ip
!
interface gigabitethernet 1/2
ip vrf forwarding VPNA
ip address 192.168.30.1 255.255.255.0
!
interface loopback 0
ip address 172.168.0.2 255.255.255.255
!
interface loopback 10
ip vrf forwarding VPNA
ip address 192.168.0.2 255.255.255.255
!
router bgp 1
neighbor 172.168.0.1 remote-as 1
neighbor 172.168.0.1 update-source loopback 0
address-family vpnv4
neighbor 172.168.0.1 activate
address-family ipv4 vrf VPNA
redistribute ospf 10
redistribute connected
!
router ospf 1
network 172.168.40.0 0.0.0.255 area 0
network 172.168.0.2 0.0.0.0 area 0
!
router ospf 10 vrf VPNA
network 192.168.30.0 255.255.255.0 area 0
redistribute bgp subnets
area 0 sham-link 192.168.0.2 192.168.0.1
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!
●P1的配置文件。
!
interface gigabitethernet 1/0
ip address 172.168.10.2 255.255.255.0
mpls ip
label-switch
!
interface gigabitethernet 1/1
ip address 172.168.40.1 255.255.255.0
mpls ip
label-switch
!
interface loopback 0
ip address 172.168.0.3 255.255.255.255
!
router ospf 1
network 172.168.40.0 0.0.0.255 area 0
network 172.168.10.0 0.0.0.255 area 0
network 172.168.0.3 0.0.0.0 area 0
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!

 

锐捷网管交换机通过OSPF协议实现快速重路由配置举例

一、组网需求
如下图:三台设备Device A、B、C属于同一OSPF区域,两两通过OSPF协议实现网络互连。当A的某一条的链路出现故障时,业务可以快速切换到备份链路上。要求切换时延尽可能降低。

二、 组网图
OSPF快速重路由配置组网图

三、配置要点
● Device A配置快速重路由。
●Device A配置接口carrier-delay 0。

四、 配置步骤
(1) 所有设备配置接口IP地址(略)。
(2) 所有设备配置OSPF基本功能(略)。
(3) 配置Device A配置快速重路由。
Device A> enable
Device A# configure terminal
Device A(config)# router ospf 1
Device A(config-router)# fast-reroute lfa
Device A(config-router)# exit

(4) Device A所有接口配置carrier-delay 0。
Device A(config)# interface gigabitethernet 0/1
Device A(config-if-GigabitEthernet 0/1)# carrier-delay 0
Device A(config-if-GigabitEthernet 0/1)# exit
Device A(config)# interface gigabitethernet 0/2
Device A(config-if-GigabitEthernet 0/2)# carrier-delay 0

五、验证配置结果
# 检查Device A路由表,192.168.4.0/24表项存在备份路由。
Device A# show ip route fast-reroute | begin 192.168.4.0
O 192.168.4.0/24 [ma] via 192.168.1.2, 00:39:28, GigabitEthernet 0/1
[b] via 192.168.2.2, 00:39:28, GigabitEthernet 0/2

六、 配置文件
Device A的配置文件。
!
router ospf 1
fast-reroute lfa
!
interface gigabitethernet 0/1
carrier-delay 0
!
interface gigabitethernet 0/2
carrier-delay 0
!

锐捷网管交换机OSPF 进程与 BFD 联动配置举例

一、组网需求
如下图:Device A、Device B和Device C之间通过运行OSPFv2协议实现网络互通。
Device A和Device B使用Switch为主链路,当Switch或者其连接链路故障上,BFD能够快速检测故障,并切换至DeviceC进行通讯。

二、 组网图
OSPF 进程与 BFD 联动配置组网图

三、配置要点
● 所有设备配置接口IP地址(略)。
●所有设备配置OSPF基本功能(略)。
●所有设备配置接口BFD参数。
● 所有设备配置OSPF联动BFD。

四、 配置步骤
(1) 在设备接口配置BFD参数。
# Device A的配置。
Device A> enable
Device A# configure terminal
Device A(config)# interface gigabitethernet 0/1
Device A(config-if-GigabitEthernet 0/1)# bfd interval 200 min_rx 200 multiplier 5
Device A(config-if-GigabitEthernet 0/1)# exit
Device A(config)# interface gigabitethernet 0/2
Device A(config-if-GigabitEthernet 0/2)# bfd interval 200 min_rx 200 multiplier 5
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)# bfd interval 200 min_rx 200 multiplier 5
Device B(config-if-GigabitEthernet 0/1)# exit
Device B(config)# interface gigabitethernet 0/2
Device B(config-if-GigabitEthernet 0/2)# bfd interval 200 min_rx 200 multiplier 5
Device B(config-if-GigabitEthernet 0/2)# exit

(2) OSPF联动BFD。
# Device A的配置。
Device A(config)# router ospf 1
Device A(config-router)# bfd all-interfaces

# Device B的配置。
Device B(config)# router ospf 1
Device B(config-router)# bfd all-interfaces

五、验证配置结果
# 检查Device A上查看OSPF联动BFD处于UP状态。
Device A# show ip ospf neighbor
OSPF process 1, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.1.2 1 Full/BDR Up 00:00:40 192.168.1.2 GigabitEthernet 0/1
192.168.13.3 1 Full/BDR Up 00:00:40 192.168.13.3 GigabitEthernet 0/2

# 检查Device B上查看OSPF联动BFD处于UP状态。
Device B# show ip ospf neighbor
OSPF process 1, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.1.1 1 Full/BDR Up 00:00:40 192.168.1.1 GigabitEthernet 0/1
192.168.13.3 1 Full/BDR Up 00:00:40 192.168.23.3

六、 配置文件
●Device A的配置文件。
!
interface gigabitethernet 0/1
bfd interval 200 min_rx 200 multiplier 5
!
interface gigabitethernet 0/2
bfd interval 200 min_rx 200 multiplier 5
!
router ospf 1
bfd all-interfaces
!
●Device B的配置文件。
!
interface gigabitethernet 0/1
bfd interval 200 min_rx 200 multiplier 5
!
interface gigabitethernet 0/2
bfd interval 200 min_rx 200 multiplier 5
!
router ospf 1
bfd all-interfaces
!

锐捷网管交换机RIP 发布聚合路由配置举例

一、组网需求
如下图,Device B和Device A、C和D之间通过RIPv2路由协议实现互联互通。
为缩小Device A的路由表,在Device B上配置路由聚合成172.16.0.0/21。

二、 组网图
RIP 发布聚合路由配置组网图

三、配置要点
(1) 所有设备配置接口IP地址(略)。
(2) 所有设备配置RIP基本功能(略)。
(3) Device B关闭自动汇总,并配置路由汇聚。

四、 配置步骤
(1) 配置各接口的IP地址和启动单播路由协议(略)。
(2) 配置设备配置RIP基本功能(略)。
(3) Device B关闭自动汇总。
Device B> enable
Device B# configure terminal
Device B(config)# router rip
Device B(config-router)# version 2
Device B(config-router)# no auto-summary
Device B(config-router)# exit

(4) Device B GigabitEthernet 0/1接口上配置172.16.0.0/21路由汇聚。
Device B(config)# interface gigabitethernet 0/1
Device B(config-if-GigabitEthernet 0/1)# ip rip summary-address 172.16.0.0 255.255.248.0

五、验证配置结果
# 检查设备A路由表,生成172.16.0.0/16表项。
Device A# show ip route rip
R 172.16.0.0/21 [120/2] via 192.168.1.2, 00:01:04, GigabitEthernet 0/1

六、 配置文件
Device B配置文件。
!
interface gigabitethernet 0/1
ip address 196.38.165.1 255.255.255.0
!
router rip
version 2
no auto-summary
!

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