码迷,mamicode.com
首页 > 其他好文 > 详细

通信导论-VLAN的配置及应用

时间:2019-05-23 17:08:07      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:隔离   back   聚合   静态   ip地址   dot1q   perm   png   span   

1.隔离广播域        技术图片

配置pc_2:192.168.1.1;pc_4:192.168.1.3

交换机:<h3c>system-view

<h3c>sysname name

[name] vlan 10

[name-vlan 10] vlan 20

[name-vlan 20]quit

[name]display vlan

[name]display vlan brief

  • [name] interface GigabitEthernet 1/0/1
  • [name] port link-type access
  • [name] port access vlan 10

在PC_2:ping 192.168.1.2 ;ping不通192.168.1.3

 

2.单臂路由               技术图片

<h3c>system-view

<h3c>sysname name

[name] vlan 10

[name-vlan 10] vlan 20

[name-vlan 20]quit

第一个交换机(接口为0/1、0/2、0/3、0/4、0/48):

  • (输入端口) [name-if-range] interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2
  •  [name-if-range] port link-type access
  •  [name-if-range] port access vlan 10

 [name-if-range] quit

  • (输出端口)[name] interface GigabitEthernet 1/0/48
  • [name-GigabitEthernet1/0/48] port link-type trunk
  • [name-GigabitEthernet1/0/48] port trunk permit vlan 10 20

第二个交换机(接口为0/1和0/48):

  • [name] interface GigabitEthernet 1/0/1
  • [name-GigabitEthernet1/0/1] port link-type trunk
  • [name-GigabitEthernet1/0/1] port trunk permit vlan 10 20
  • [name] interface GigabitEthernet 1/0/48
  • [name-GigabitEthernet1/0/48] port link-type trunk
  • [name-GigabitEthernet1/0/48] port trunk permit vlan 10 20

路由器(接口为0/0):

  • [name] interface gi 0/0.10
  • [name-GigabitEthernet0/0.10] vlan-type dot1q vid 10()
  • [name-GigabitEthernet0/0.10] ip address 192.168.10.254 10 (网关)

 

3.静态链路聚合技术图片技术图片

配置步骤:1.配置pc的ip地址

2. 配置连接pc的接口模式

3.配置链路聚合

配置pc_3:192.168.10.1;pc_4:192.168.2.1;pc_5:192.168.10.2;pc_6:192.168.20.2;

第一个交换机(接口为0/46、0/47必须为连续接口、0/1、0/2、0/3、0/4):

<H3C>system-view

[H3C]sysname sw1

[sw1] vlan 10

[sw1-vlan10]vlan 20

[sw1-vlan10]quit

  • (输入端口)[sw1] interface  gi 1/0/1
  • [sw1-GigabitEthernet1/0/1] port link-type access
  • [sw1-GigabitEthernet1/0/1] port access vlan 10

(输出端口)[sw1] interface bridge 1()

[sw1-Bridge-Aggregation1] quit 

  • [sw1] interface range gi 1/0/46 to gi 1/0/48
  • [sw1-if-range] port link-mode bridge()
  • [sw1-if-range] port link-aggregation group 1()

[sw1-if-range] quit

  • [sw1] interface bridge-aggregation 1
  • [sw1-Bridge-Aggregation1] port link-type trunk
  • [sw1-Bridge-Aggregation1] port trunk permit vlan 10 20

[sw1]display link-aggregation summary

第二个交换机(接口为0/1、0/2、0/3必须为连续接口):

[sw2]interface bridge 1

[sw2-Bridge-Aggregation1]quit 

  • [sw2] interface range gi 1/0/1 to gi 1/0/3
  • [sw2-if-range] port link-mode bridge
  • [sw2-if-range] port link-aggregation group 1

[sw2-if-range] quit

  • [sw2] interface bridge-aggregation 1
  • [sw2-if-range] port link-type trunk
  • [sw2-if-range] port trunk permit vlan 10 20

[sw2] display cu

pc_3:ping 192.168.10.2

 

4.动态链路聚合

 

 5.vlan间路由             技术图片

配置pc_2:192.168.10.1;pc_4:192.168.20.1

<H3C>system-view

[H3C]sysname sw1

[sw1] vlan 10

[sw1-vlan10]vlan 20

[sw1-vlan10]quit

  • (输入端口)[sw1] interface range gi 1/0/1 to gi 1/0/2
  • [sw1-if-range] port link-type access
  • [sw1-if-range] port access vlan 10
  • [sw1-Vlan-interface10] interface vlan-interface 10()
  • [sw1-Vlan-interface10] ip address 192.168.10.254 24

ping 192.168.10.254(网关);192.168.20.254;192.168.20.1

 

6.静态路由的配置          技术图片

第一个路由器(接口为0/0):

  • [R1] interface loopback 0(设置环路ip地址)
  • [R1-LoopBack0] ip address 192.168.10.1 24

[R1-LoopBack0] quit

  • [R1]interface GigabitEthernet 0/0(设置端口ip地址)
  • [R1-GigabitEthernet0/0] ip address 10.1.1.1 30

[R1-GigabitEthernet0/0]dis ip interface brief

[R1-GigabitEthernet0/0] quit

  • [R1] ip route-static 10.1.1.4 30(网段) 10.1.1.2(下一跳)→设置非直连网段
  • [R1] ip route-static 172.16.1.0 24 10.1.1.2
  • [R1] display ip routing-table

第二个路由器(端口为0/0、0/1):

  • [R2] interface GigabitEthernet 0/0
  • [R2-GigabitEthernet0/0] ip address 10.1.1.2 30
  • [R2-GigabitEthernet0/0] interface GigabitEthernet 0/1
  • [R2-GigabitEthernet0/1] ip address 10.1.1.5 30

[R2-GigabitEthernet0/1]dis ip interface brief

[R2-GigabitEthernet0/1] quit

  • [R2] ip route-static 192.168.10.0  30  10.1.1.1
  • [R2] ip route-static 172.16.1.0 24 10.1.1.6
  • [R2] display ip routing-table

第三个路由器(端口为0/0):

  • [R3] interface loopback 0(设置环路ip地址)
  • [R3-LoopBack0] ip address 172.16.1.1 24

[R3-LoopBack0] quit

  • [R3]interface GigabitEthernet 0/0(设置端口ip地址)
  • [R3-GigabitEthernet0/0] ip address 10.1.1.1 30

[R3-GigabitEthernet0/0]dis ip interface brief

[R3-GigabitEthernet0/0] quit

  • [R3] interface GigabitEthernet 0/0
  • [R3-GigabitEthernet0/0] ip address 10.1.1.6 30

[R3-GigabitEthernet0/0]dis ip interface brief

[R3-GigabitEthernet0/0] quit

  • [R3] ip route-static 192.168.10.0  30 10.1.1.5
  • [R3] ip route-static 10.1.1.0 30 10.1.1.5
  • [R3] display ip routing-table

通信导论-VLAN的配置及应用

标签:隔离   back   聚合   静态   ip地址   dot1q   perm   png   span   

原文地址:https://www.cnblogs.com/happy--hh/p/10765126.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!