IPv4路由典型配置-OSPF
一、组网说明
网络中的三台设备运行OSPF协议,接口地址如下图。
配置单区OSPF协议确保三台设备之间可以互访。
二、组网图
三、配置步骤
SW 1的配置
#配置三层接口地址及Loopback接口地址
switch(config)#interface vlan10
switch(config-If-Vlan10)#ip address192.168.10.1 255.255.255.0
switch(config-If-Vlan10)#exit
switch(config)#interface vlan20
switch(config-If-Vlan20)#ip address192.168.20.1 255.255.255.0
switch(config-If-Vlan20)#exit
switch(config)#interface loopback 1
switch(config-If-loopback1)#ip address10.1.1.1 255.255.255.255
switch(config-If-loopback1)#exit
#配置OSPF协议,宣告设备所连的网段
switch(config)#router ospf
switch(config-router)#router-id10.1.1.1
switch(config-router)#nework192.168.10.1/24 area 0
switch(config-router)#nework192.168.20.1/24 area 0
switch(config-router)#exit
SW 2的配置
#配置三层接口地址及Loopback接口地址
switch(config)#interface vlan10
switch(config-If-Vlan10)#ip address192.168.10.2 255.255.255.0 switch(config-If-Vlan10)#exit
switch(config)#interface vlan30
switch(config-If-Vlan30)#ip address192.168.30.1 255.255.255.0 switch(config-If-Vlan30)#exit
switch(config)#interface loopback 1
switch(config-If-loopback1)#ip address10.1.1.2 255.255.255.255 switch(config-If-loopback1)#exit
#配置OSPF协议,宣告设备所连的网段
switch(config)#router ospf
switch(config-router)#router-id10.1.1.2
switch(config-router)#nework192.168.10.1/24 area 0
switch(config-router)#nework192.168.30.1/24 area 0
switch(config-router)#exit
SW 3的配置
#配置三层接口地址及Loopback接口地址
switch(config)#interface vlan20
switch(config-If-Vlan20)#ip address192.168.20.2 255.255.255.0 switch(config-If-Vlan20)#exit
switch(config)#interface vlan30
switch(config-If-Vlan30)#ip address192.168.30.2 255.255.255.0 switch(config-If-Vlan30)#exit
switch(config)#interface loopback 1
switch(config-If-loopback1)#ip address10.1.1.3 255.255.255.255 switch(config-If-loopback1)#exit
#配置OSPF协议,宣告设备所连的网段
switch(config)#router ospf
switch(config-router)#router-id10.1.1.3
switch(config-router)#nework192.168.20.1/24 area 0
switch(config-router)#nework192.168.30.1/24 area 0
switch(config-router)#exit
四、注意事项
无
本手册版权为DCN所有,欢迎传阅
如果有任何意见或建议,请联系 400-810-9119。