扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
//实现:通过配置动态路由协议OSPF学习产生路由。
//环境:
CISCO 3560
Router01
Router02
VLAN2-PC01
PC02
//拓扑:如图(110422-路由器OSPF动态路由配置)
//配置CISCO 3560
CISCO 3560>enable
CISCO 3560#configure terminal
CISCO 3560(config)#vlan 2
CISCO 3560(config-vlan)#exit
CISCO 3560(config)#vlan 3
CISCO 3560(config-vlan)#exit
CISCO 3560(config)#interface fastEthernet 0/1
CISCO 3560(config-if)#switchport access vlan 2
CISCO 3560(config-if)#exit
CISCO 3560(config)#inter fastEthernet 0/24
CISCO 3560(config-if)#switchport access vlan 3
CISCO 3560(config-if)#exit
CISCO 3560(config)#interface vlan 2
CISCO 3560(config-if)#ip address 192.168.1.1 255.255.255.0
CISCO 3560(config-if)#no shutdown
CISCO 3560(config-if)#exit
CISCO 3560(config)#interface vlan 3
CISCO 3560(config-if)#ip address 192.168.3.1 255.255.255.0
CISCO 3560(config-if)#no shutdown
CISCO 3560(config-if)#exit
CISCO 3560(config)#router ospf 1 //进入OSPf视图
CISCO 3560(config-router)#network 192.168.1.0 0.0.0.255 area 0 //发布直连路由
CISCO 3560(config-router)#network 192.168.3.0 0.0.0.255 area 0
CISCO 3560(config-router)#end
CISCO 3560#write
CISCO 3560#show vlan
CISCO 3560#show ip router[nextpage]
//配置Router01
Router01>enable
Router01#configure terminal
Router01(config)#interface fastEthernet 1/0
Router01(config-if)#no shutdown
Router01(config-if)#ip address 192.168.3.2 255.255.255.0
Router01(config-if)#exit
Router01(config)#interface serial 2/0
Router01(config-if)#ip address 192.168.4.1 255.255.255.0
Router01(config-if)#clock rate 64000
Router01(config-if)#no shutdown
Router01(config-if)#exit
Router01(config)#router ospf 1
Router01(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router01(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router01(config-router)#end
Router01#write
//配置Router02
Router02>enable
Router02#configure terminal
Router02(config)#interface fastEthernet 1/0
Router02(config-if)#no shutdown
Router02(config-if)#ip address 192.168.2.1 255.255.255.0
Router02(config-if)#exit
Router02(config)#interface serial 2/0
Router02(config-if)#ip address 192.168.4.2 255.255.255.0
Router02(config-if)#no shutdown
Router02(config-if)#exit
Router02(config)#router ospf 1
Router02(config-router)#network 192.168.2.0 0.0.0.255 area 0
Router02(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router02(config-router)#end
Router02#write
Router02#show ip router
//测试:(终端计算机)
VLAN2-PC01>ping 192.168.2.101
Pinging 192.168.2.101 with 32 bytes of data:
Reply from 192.168.2.101: bytes=32 time=23ms TTL=125
Reply from 192.168.2.101: bytes=32 time=16ms TTL=125
Ping statistics for 192.168.2.101:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 16ms, Maximum = 23ms, Average = 19ms
Control-C
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者