《H3C三层交换机OSPF路由协议(H3C网络设备).docx》由会员分享,可在线阅读,更多相关《H3C三层交换机OSPF路由协议(H3C网络设备).docx(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、H3C三层交换机OSPF路由协议(H3C网络设备)OSPF路由协议 6.3.1 OSPF的基本配置 两台PC所在网段,通过两台运用OSPF协议的路由器实现互连互通。 RouterA配置脚本 # sysname RouterA # router id 1.1.1.1 /配置router id和loopback0地址一样/ # radius scheme system # domain system # interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0 # interface Serial0/0 link-protocol ppp ip
2、 address 20.1.1.1 255.255.255.252 # interface NULL0 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # ospf 1 /启动ospf路由协议/ area 0.0.0.0/创建区域0/ network 1.1.1.1 0.0.0.0 /接口loop 0使能OSPF/ network 10.1.1.0 0.0.0.255 /接口e0/0使能OSPF/ network 20.1.1.0 0.0.0.3 /接口s0/0使能OSPF/ # user-interface con 0 use
3、r-interface vty 0 4 # return RouterB配置脚本 # sysname RouterB # router id 1.1.1.2 /配置router id和loopback0地址一样/ # radius scheme system # domain system # interface Ethernet0/0 ip address 30.1.1.1 255.255.255.0 # interface Serial0/0 link-protocol ppp ip address 20.1.1.2 255.255.255.252 # interface NULL0 #
4、interface LoopBack0 ip address 1.1.1.2 255.255.255.255 # ospf 1/启动ospf路由协议/ area 0.0.0.0/创建区域0/ network 1.1.1.2 0.0.0.0 /接口loop 0使能OSPF/ network 20.1.1.0 0.0.0.3 /接口s0/0使能OSPF/ network 30.1.1.0 0.0.0.255 /接口e0/0使能OSPF/ # user-interface con 0 user-interface vty 0 4 # return RouterA和RouterB可以通过OSPF学习到
5、对方路由信息,并可以ping通对方网段。 RouterA路由表: RouterAdisp ip routing-table Routing Table: public net Destination/Mask Protocol Pre Cost Nexthop Interface 1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 1.1.1.2/32 OSPF 10 1563 20.1.1.2 Serial0/0 10.1.1.0/24 DIRECT 0 0 10.1.1.1 Ethernet0/0 10.1.1.1/32 DIRECT 0 0 127.0
6、.0.1 InLoopBack0 20.1.1.0/30 DIRECT 0 0 20.1.1.1 Serial0/0 20.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 20.1.1.2/32 DIRECT 0 0 20.1.1.2 Serial0/0 30.1.1.0/24 OSPF 10 1563 20.1.1.2 Serial0/0 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopB RouterA配置脚本 # sysname R
7、outerA # router id 1.1.1.1 /配置router id和loopback0地址一样/ # radius scheme system # domain system # interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0 # interface Serial0/0 link-protocol ppp ip address 20.1.1.1 255.255.255.252 # interface NULL0 # interface LoopBack0 ip address 1.1.1.1 255.255.255.2
8、55 # ospf 1 /启动ospf路由协议/ area 0.0.0.0/创建区域0/ network 1.1.1.1 0.0.0.0 /接口loop 0使能OSPF/ network 10.1.1.0 0.0.0.255 /接口e0/0使能OSPF/ network 20.1.1.0 0.0.0.3 /接口s0/0使能OSPF/ # user-interface con 0 user-interface vty 0 4 # return RouterB配置脚本 # sysname RouterB # router id 1.1.1.2 /配置router id和loopback0地址一样/
9、 # radius scheme system # domain system # interface Ethernet1/0/0 ip address 30.1.1.1 255.255.255.0 # interface Serial2/0/0 link-protocol ppp ip address 20.1.1.2 255.255.255.252 # interface NULL0 # interface LoopBack0 ip address 1.1.1.2 255.255.255.255 # ospf 1/启动ospf路由协议/ import-route direct/引入接口直连
10、路由/ area 0.0.0.0/创建区域0/ network 1.1.1.2 0.0.0.0 /接口loop 0使能OSPF/ network 20.1.1.0 0.0.0.3 /接口s0/0使能OSPF/ # user-interface con 0 user-interface vty 0 4 # return RouterA和RouterB可以通过OSPF学习到对方路由信息,并可以ping通对方网段。RouterA路由表: RouterAdisp ip routing-table Routing Table: public net Destination/Mask Protocol P
11、re Cost Nexthop Interface 1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 1.1.1.2/32 OSPF 10 1563 20.1.1.2 Serial0/0 10.1.1.0/24 DIRECT 0 0 10.1.1.1 Ethernet0/0 10.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 20.1.1.0/30 DIRECT 0 0 20.1.1.1 Serial0/0 20.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 20.1.1.2/32
12、 DIRECT 0 0 20.1.1.2 Serial0/0 30.1.1.0/24 O_ASE 150 1 20.1.1.2 Serial0/0 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 1、 建议将router id 指定和loopback 0接口地址一样。2、 network中须要运用反掩码(wildcard bits)。3、 第一种和其次种方法的区分在于:以太网接口地址的通告方法不同。方法一在以太网上运行OSPF来通告路由,方法二通过引入直连接口的方式来通过路由。4、关于ospf network-type的配置原则 Quidway路由器的网络类型缺省如下 OSPF网络类型 链路层协议 p2p PPP、loopback NBMA fr,x25,HDLC p2mp 无 broadcast Ethernet 5、互连的路由器网络类型必需一样。6、对于接口类型为NBMA的网络,由于无法通过广播Hello报文的形式发觉相邻路由器,必需手工为其指定相邻路由器的IP地址: Quidway-ospf-1peer 20.1.1.2 (此文档部分内容来源于网络,如有侵权请告知删除,文档可自行编辑修改内容,供参考,感谢您的支持)