H3C三层vlan路由实验

实验拓扑

H3C三层vlan路由实验

图 1-1

注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字为 2 的设备,以此类推;另外,同一网段中,IP 地址的主机位为其设备编号,如 R3 的 g0/0 接口若在 192.168.1.0/24网段,则其 IP 地址为 192.168.1.3/24,以此类推


实验需求

  1. 按照图示创建 Vlan,所有接口配置为 Access 类型加入相应互联 VLAN

  1. 按照图示配置 IP 地址

  1. 配置 OSPF,实现全网互通


实验解法

  1. 按照图示创建 Vlan,所有接口配置为 Access 类型加入响应互联 VLAN

      分析:根据需求,每台交换机上只需要创建本端的互联 VLAN 即可,并把相应接口加入到对应的互联 VLAN。如果接口配置为 Trunk 的话,可能会造成 Vlan1 和其他 Vlan 存在环路而被 STP 阻塞端口,导致路由不通
      
    步骤 1:在 SW1 上创建 Vlan10 和 Vlan20,G1/0/1 口加入到 Vlan20,G1/0/2 口加入到 Vlan10。

<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn sw1
[sw1]vlan 20
[sw1-vlan20]port g1/0/1
[sw1-vlan20]vlan 10
[sw1-vlan10]port g1/0/2

步骤 2:在 SW2 上创建 Vlan10 和 Vlan30,G1/0/1 口加入到 Vlan30,G1/0/2 口加入到 Vlan10。

<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn sw2
[sw2]vlan 10
[sw2-vlan10]port g1/0/2
[sw2-vlan10]vlan 30
[sw2-vlan30]port g1/0/1

步骤 3:在 SW3 上创建 Vlan30 和 Vlan40,G1/0/1 口加入到 Vlan30,G1/0/2 口加入到 Vlan40。

<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn sw3
[sw3]vlan 30
[sw3-vlan30]port g1/0/1
[sw3-vlan30]vlan 40
[sw3-vlan40]port g1/0/2

步骤 4:在 SW4 上创建 Vlan20 和 Vlan40,G1/0/1 口加入到 Vlan20,G1/0/2 口加入到 Vlan40。

<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn sw4
[sw4]vlan 40
[sw4-vlan40]port g1/0/2
[sw4-vlan40]vlan 20
[sw4-vlan20]port g1/0/1
  1. 按照图示配置 IP 地址

    步骤 1:创建 Vlan10 和 Vlan20 的三层接口,并配置 IP 地址

    [sw1-vlan10]int vlan 10
    [sw1-Vlan-interface10]ip add 100.1.1.1 24
    [sw1-Vlan-interface10]int vlan 20
    [sw1-Vlan-interface20]ip add 100.2.2.1 24

步骤 2:创建 Vlan10 和 Vlan30 的三层接口,并配置 IP 地址

[sw2-vlan30]int vlan 10
[sw2-Vlan-interface10]ip add 100.1.1.2 24
[sw2-Vlan-interface10]int vlan 30
[sw2-Vlan-interface30]ip add 100.3.3.2 24

步骤 3:创建 Vla30 和 Vlan40 的三层接口,并配置 IP 地址

[sw3-vlan40]int vlan 30
[sw3-Vlan-interface30]ip add 100.3.3.3 24
[sw3-Vlan-interface30]int vlan 40
[sw3-Vlan-interface40]ip add 100.4.4.3 24

步骤 4:创建 Vlan40 和 Vlan20 的三层接口,并配置 IP 地址

[sw4-vlan20]int vlan 40
[sw4-Vlan-interface40]ip add 100.4.4.4 24
[sw4-Vlan-interface40]int vlan 20
[sw4-Vlan-interface20]ip add 100.2.2.4 24
  1. 配置 OSPF,实现全网互通

    步骤 1:在 SW1 上配置 OSPF

    [sw1-Vlan-interface20]int loo 0
    [sw1-LoopBack0]ip add 1.1.1.1 32
    [sw1-LoopBack0]ospf rou 1.1.1.1
    [sw1-ospf-1]a 0
    [sw1-ospf-1-area-0.0.0.0]netw 1.1.1.1 0.0.0.0
    [sw1-ospf-1-area-0.0.0.0]netw 100.1.1.0 0.0.0.255
    [sw1-ospf-1-area-0.0.0.0]netw 100.2.2.0 0.0.0.255

步骤 2:在 SW2上配置 OSPF

[sw2-Vlan-interface30]int loo 0
[sw2-LoopBack0]ip add 2.2.2.2 32
[sw2-LoopBack0]ospf rou 2.2.2.2
[sw2-ospf-1]a 0
[sw2-ospf-1-area-0.0.0.0]netw 2.2.2.2 0.0.0.0
[sw2-ospf-1-area-0.0.0.0]netw 100.1.1.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]netw 100.3.3.0 0.0.0.255

步骤 3:在 SW3上配置 OSPF

[sw3-Vlan-interface40]int loo 0
[sw3-LoopBack0]ip add 3.3.3.3 32
[sw3-LoopBack0]ospf rou 3.3.3.3
[sw3-ospf-1]a 0
[sw3-ospf-1-area-0.0.0.0]netw 3.3.3.3 0.0.0.0
[sw3-ospf-1-area-0.0.0.0]netw 100.3.3.0 0.0.0.255
[sw3-ospf-1-area-0.0.0.0]netw 100.4.4.0 0.0.0.255

步骤 4:在 SW4上配置 OSPF

[sw4-Vlan-interface20]int loo 0
[sw4-LoopBack0]ip add 4.4.4.4 32
[sw4-LoopBack0]ospf rou 4.4.4.4
[sw4-ospf-1]a 0
[sw4-ospf-1-area-0.0.0.0]netw 4.4.4.4 0.0.0.0
[sw4-ospf-1-area-0.0.0.0]netw 100.4.4.0 0.0.0.255
[sw4-ospf-1-area-0.0.0.0]netw 100.2.2.0 0.0.0.255

7,使用sw1测试ping其他交换机,都是可以通的

  • 6
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月夜行舟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值