频道栏目
首页 > 安全 > 网站安全 > 正文

OSPF基本配置-qq5ca7fbcdb091c的博客-51CTO博客

2019-05-07 18:08:52           
收藏   我要投稿

OSPF基本配置

1.(如上图)搭建好内部环境后
2.开始配置
路由器(AR1)
interface GigabitEthernet0/0/0
ip address 192.168.20.1 255.255.255.0
interface g0/0/1
ip address 192.168.22.1 255.255.255.0
quit
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.20.0 0.0.0.255
area 0.0.0.1
network 192.168.22.0 0.0.0.255
return

路由器(AR2)
interface GigabitEthernet0/0/0
ip address 192.168.23.1 255.255.255.0
interface g0/0/1
ip address 192.168.21.1 255.255.255.0
quit
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 192.168.23.0 0.0.0.255
area 0.0.0.1
network 192.168.21.0 0.0.0.255
return

三层交换机(SW2)
vlan batch 10 12 15 20 21
port-group 1
group-member g/0/0/1 g0/02 g0/03
port link-type trunk
port trunk allow-pass vlan all
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 20
interface g0/0/5
port link-type access
port default vlan 21
quit
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
interface Vlanif12
ip address 192.168.12.1 255.255.255.0
interface Vlanif15
ip address 192.168.15.1 255.255.255.0
interface Vlanif20
ip address 192.168.20.2 255.255.255.0
interface Vlanif21
ip address 192.168.21.2 255.255.255.0
quit
ospf 1 router-id 12.12.12.12
area 0.0.0.0
network 192.168.20.0 0.0.0.255
network 192.168.15.0 0.0.0.255
network 192.168.10.0 0.0.0.255
area 0.0.0.1
network 192.168.21.0 0.0.0.255
network 192.168.12.0 0.0.0.255
return

三层交换机(SW4)
vlan batch 11 13 15 22 23
port-group 1
group-member g0/0/1 g0/0/3 g0/0/4
port link-type trunk
port trunk allow-pass vlan all
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 22
interface g0/0/5
port link-type access
port default vlan 23
quit
interface Vlanif11
ip address 192.168.11.1 255.255.255.0
interface Vlanif13
ip address 192.168.13.1 255.255.255.0
interface vlanif 15
ip address 192.168.15.2 255.255.255.0
interface vlanif 22
ip address 192.168.22.2 255.255.255.0
interface vlanif 23
ip address 192.168.23.2 255.255.255.0
quit
ospf 1 router-id 14.14.14.14
area 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.15.0 0.0.0.255
network 192.168.13.0 0.0.0.255
area 0.0.0.1
network 192.168.22.0 0.0.0.255
network 192.168.11.0 0.0.0.255
return

三层交换机(SW1)
vlan batch 5 10 11
port-group 1
group-member g0/0/1 g0/0/2 g0/0/3
port link-type trunk
port trunk allow-pass vlan all
quit
interface Vlanif5
ip address 192.168.5.1 255.255.255.0
interface Vlanif10
ip address 192.168.10.2 255.255.255.0
interface Vlanif11
ip address 192.168.11.2 255.255.255.0
quit
ospf 1 router-id 11.11.11.11
area 0.0.0.0
network 192.168.10.0 0.0.0.255
network 192.168.5.0 0.0.0.255
area 0.0.0.1
network 192.168.11.0 0.0.0.255
return

    三层交换机(SW3)
    vlan batch 5 12 13
    port-group 1
     group-member    g0/0/1  g0/0/2  g0/0/3
             port   link-type  trunk
             port   trunk  allow-pass  vlan  all
             quit
  interface Vlanif5
     ip address 192.168.5.2 255.255.255.0
interface Vlanif12
     ip address 192.168.12.2 255.255.255.0
interface Vlanif13
     ip address 192.168.13.2 255.255.255.0
    quit
    ospf 1 router-id 13.13.13.13
     area 0.0.0.0
        network 192.168.5.0 0.0.0.255
        network 192.168.13.0 0.0.0.255
     area 0.0.0.1
        network 192.168.12.0 0.0.0.255
return

    3.测试
      1)用三层交换机(SW1或SW3)ping路由器(Ar1或Ar2)
        2) 当用三层交换机SW3去ping其他主机时,会出现可以ping通路由器Ar2、SW4、SW1,却ping不通SW2与Ar1,这是因为与数据链路有关,只需将路由器Ar1的g/0/01接口的IP地址删掉在重新宣告,之后再进行ping测试,则三层交换机SW3可以ping所有设备主机了

相关TAG标签
上一篇:闲谈思科交换机与路由器的架构及流程-wx5cb84aa50a8d9的博客-51CTO博客
下一篇:配置接口IP地址并通过静态路由、默认路由配置实现全网互通。-mb5cc5c81e2ec60的博客-51CTO博客
相关文章
图文推荐
文章
推荐
热门新闻

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站