zoukankan      html  css  js  c++  java
  • 单臂路由实现vlan间的通信

    拓扑图

    单臂路由实现vlan间的通信

    首先要用到vtp协议

    switch 5 配置

    Switch(config)#vtp domain test

    switch 4配置

    Switch(config)#vtp domain test
    Changing VTP domain name from NULL to test
    Switch(config)#vtp mode client
    Setting device to VTP CLIENT mode.
    Switch(config)#

    switch 1,2,3与4一致

     在switch 5上创建vlan

    Switch(config)#
    Switch(config)#vlan 10
    Switch(config-vlan)#exit
    Switch(config)#vlan 20
    Switch(config-vlan)#exit
    Switch(config)#vlan 30
    Switch(config-vlan)#exit

    在switch 5和switch 4 上配置中继链路

    switch 5 的配置

    Switch(config)#
    Switch(config)#int range f0/1-2
    Switch(config-if-range)#switchport mode trunk

    Switch(config)#int f0/24

    Switch(config-if)#switchport mode trunk

    switch 4 的配置

    Switch(config)#int range f0/1-2
    Switch(config-if-range)#switchport mode trunk

    配置单臂路由

    进入虚拟接口f0/0.N

    使用命令 encapsulation dot1Q  来封装协议

    Router#conf t

    Router(config)#int f0/0

    Router(config-if)#no shu
    Router(config-if)#
     

    Router(config-if)#int f0/0.1
    Router(config-subif)#

    Router(config-subif)#encapsulation dot1Q 10
    Router(config-subif)#ip addr 192.168.1.254 255.255.255.0
    Router(config-subif)#int f0/0.2
    Router(config-subif)#

    Router(config-subif)#encapsulation dot1Q  20
    Router(config-subif)#ip addr 192.168.2.254 255.255.255.0
    Router(config-subif)#

    Router(config-subif)#int f0/0.3
    Router(config-subif)#encapsulation dot1Q  30
    Router(config-subif)#ip addr 192.168.3.254 255.255.255.0

    Router(config-subif)#exit
    配置完成 ,测试
    pc1 ping pc 6

    vlan10 与vlan 30可以通信

    pc 2  ping  pc7

     

    vlan10 与vlan 20 可以通信

    单臂路由已实现跨vlan通信

  • 相关阅读:
    快速幂(Fast Pow)
    半小时写完替罪羊重构点分树做动态动态点分治之紫荆花之恋的wyy贴心指导
    POJ2942 UVA1364 Knights of the Round Table 圆桌骑士
    二分图判定
    Tarjan求点双连通分量
    POJ1523 SPF 单点故障
    OI比赛常数优化
    Tarjan求割点
    NOIP2015 D1T1 神奇的幻方
    NOIP2016 D2T2 蚯蚓
  • 原文地址:https://www.cnblogs.com/knightysa/p/9179396.html
Copyright © 2011-2022 走看看