SW2

  1. Switch>en
  2. Switch#conf t
  3. Enter configuration commands, one per line. End with CNTL/Z.
  4.  
  5. Switch(config)#hostname SW2
  6. SW2(config)#vlan
  7. SW2(config-vlan)#name caiwu
  8. SW2(config-vlan)#vlan
  9. SW2(config-vlan)#name it
  10. SW2(config-vlan)#exit
  11.  
  12. SW2(config)#interface range fastEthernet /-
  13.  
  14. SW2(config-if-range)#switchport mode access
  15.  
  16. SW2(config-if-range)#switchport access vlan
  17.  
  18. SW2(config-if-range)#interface fastEthernet /
  19.  
  20. SW2(config-if)#switchport mode access
  21.  
  22. SW2(config-if)#switchport access vlan
  23. SW2(config-if)#exit
  24.  
  25. SW2(config)#do show vlan br
  26.  
  27. VLAN Name Status Ports
  28. ---- -------------------------------- --------- -------------------------------
  29. default active Fa0/, Fa0/, Fa0/, Fa0/
  30. Fa0/, Fa0/, Fa0/, Fa0/
  31. Fa0/, Fa0/, Fa0/, Fa0/
  32. Fa0/, Fa0/, Fa0/, Fa0/
  33. Fa0/, Fa0/, Fa0/, Fa0/
  34. Fa0/, Gig0/, Gig0/
  35. caiwu active Fa0/, Fa0/
  36. it active Fa0/
  37. fddi-default active
  38. token-ring-default active
  39. fddinet-default active
  40. trnet-default active
  41.  
  42. SW2(config)#interface gigabitEthernet /
  43.  
  44. SW2(config-if)#switchport mode trunk

SW1

  1. Switch>en
  2. Switch#conf t
  3. Enter configuration commands, one per line. End with CNTL/Z.
  4.  
  5. Switch(config)#hostname SW1
  6. SW1(config)#vlan
  7. SW1(config-vlan)#name caiwu
  8. SW1(config-vlan)#vlan
  9. SW1(config-vlan)#name it
  10. SW1(config-vlan)#exit
  11.  
  12. SW1(config)#interface gigabitEthernet /
  13.  
  14. SW1(config-if)#switchport mode trunk
  15. Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
  16.  
  17. #三层交换机要打trunj,需要开启dot1q协议
  18. SW1(config-if)#switchport trunk encapsulation dot1q
  19.  
  20. SW1(config-if)#switchport mode trunk
  21.  
  22. SW1(config-if)# exit
  23.  
  24. #进入VLAN2
  25. SW1(config)#interface vlan
  26.  
  27. %LINK--CHANGED: Interface Vlan2, changed state to up
  28.  
  29. %LINEPROTO--UPDOWN: Line protocol on Interface Vlan2, changed state to up
  30.  
  31. #配置VLAN2的网关
  32. SW1(config-if)#ip add 192.168.2.254 255.255.255.0
  33.  
  34. SW1(config-if)#no shutdown
  35.  
  36. SW1(config-if)#interface vlan
  37.  
  38. %LINK--CHANGED: Interface Vlan3, changed state to up
  39.  
  40. %LINEPROTO--UPDOWN: Line protocol on Interface Vlan3, changed state to up
  41.  
  42. SW1(config-if)#ip add 192.168.2.254 255.255.255.0
  43.  
  44. SW1(config-if)#no shutdown
  45.  
  46. SW1(config-if)#exit
  47.  
  48. SW1#show ip interface brief
  49. Interface IP-Address OK? Method Status Protocol
  50. FastEthernet0/ unassigned YES unset down down
  51. FastEthernet0/ unassigned YES unset down down
  52. FastEthernet0/ unassigned YES unset down down
  53. FastEthernet0/ unassigned YES unset down down
  54. FastEthernet0/ unassigned YES unset down down
  55. FastEthernet0/ unassigned YES unset down down
  56. FastEthernet0/ unassigned YES unset down down
  57. FastEthernet0/ unassigned YES unset down down
  58. FastEthernet0/ unassigned YES unset down down
  59. FastEthernet0/ unassigned YES unset down down
  60. FastEthernet0/ unassigned YES unset down down
  61. FastEthernet0/ unassigned YES unset down down
  62. FastEthernet0/ unassigned YES unset down down
  63. FastEthernet0/ unassigned YES unset down down
  64. FastEthernet0/ unassigned YES unset down down
  65. FastEthernet0/ unassigned YES unset down down
  66. FastEthernet0/ unassigned YES unset down down
  67. FastEthernet0/ unassigned YES unset down down
  68. FastEthernet0/ unassigned YES unset down down
  69. FastEthernet0/ unassigned YES unset down down
  70. FastEthernet0/ unassigned YES unset down down
  71. FastEthernet0/ unassigned YES unset down down
  72. FastEthernet0/ unassigned YES unset down down
  73. FastEthernet0/ unassigned YES unset down down
  74. GigabitEthernet0/ unassigned YES unset up up
  75. GigabitEthernet0/ unassigned YES unset down down
  76. Vlan1 unassigned YES unset administratively down down
  77. Vlan2 192.168.2.254 YES manual up up
  78. Vlan3 192.168.3.254 YES manual up up
  79. SW1#
  80.  
  81. #开启三层交换的路由功能
  82.  
  83. SW1#conf t
  84. Enter configuration commands, one per line. End with CNTL/Z.
  85.  
  86. SW1(config)#ip routing

配置3层交换机VLAN间通信的更多相关文章

  1. Cisco基础(二):三层交换vlan间通信、多交换机vlan间通信、三层交换配置路由、RIP动态路由配置、三层交换配置RIP动态路由

    一.三层交换vlan间通信 目标: VLAN实现了广播域的隔离,同时也将VLAN间的通信隔离了.三层交换技术使得VLAN间可以通信. 通过三层交换实现VLAN间通信 方案: 为了解决了传统路由器低速. ...

  2. 交换机基础配置之三层交换机实现vlan间通信

    我们以上面的拓扑图做实验,要求为pc1,pc2,pc3配置为vlan10,pc4,pc5,pc6配置为vlan20,pc7,pc8,pc9配置为vlan30 server0和server1配置为vla ...

  3. 路由器基础配置之单臂路由实现vlan间通信

    我们将以上面的拓扑图开始进行配置,目的为设置单臂路由实现vlan间通信,设置4个vlan,pc0,1,2为vlan10 pc3,4,5为vlan20:pc6,7,8为vlan30:server0,1为 ...

  4. OSPF与Vlan间通信综合实验小结与端口隔离

      总结 本实验模拟实际工作环境的网络拓扑结构,至此终于理解了一部分的配置思路: 一.三层交换机连接路由器的端口配置 图中GE0/0/4应该是配置成access类型,这个时候应该是不带vlan标签的. ...

  5. 通过SVI实现VLAN间通信

    两个不同网段的计算机与三层交换机直连,通过SVI实现VLAN间通信vlan 1 //几个不同网段就创建几个VLANvlan 2 int f0/1 //划分VLANswitchport mode acc ...

  6. 单臂路由实现不同vlan间通信

    单臂路由实现不同vlan间通信 拓扑图 PC配置 PC1 :192.168.1.1 vlan10 192.168.1.254 PC2 :192.168.2.1 vlan20 192.168.2.254 ...

  7. 在配置和销售凭证 GET_CONFIG_MODE 间通信时内部出错

    “在配置和销售凭证 GET_CONFIG_MODE 间通信时内部出错” 订单打开出现这种错误提示,多半是配置对象号问题. SAP NOTE 2019-09-27 901893901893 - Repo ...

  8. 不同vlan间通信的三种配置方式

    1.单臂路由(图) 环境:一台路由器,一台二层交换机,两台pc机 二层交换机的配置 //创建vlan 和 vlan : Switch(config)#vlan Switch(config-vlan)# ...

  9. 路由器配置——单臂路由实现VLAN间通信

    一.实验目的:用路由器使同和不同vlan可以通信 二.拓扑图如下: 三.具体步骤: (1)R1路由器配置: Router>en  --进入特权模式Router#conf t  --进入全局配置模 ...

随机推荐

  1. index.html jquery

    index.html   <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

  2. angular6 safe url pipe

    safe-url.pipe.ts import { Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer } from ' ...

  3. Centos 7 squid 用户认证

    一.安装安装过程十分简便,只需要安装一下squid,一条命令搞定yum install squidrpm -qa | grep squidsquid-3.5.20-2.el7_3.2.x86_64 二 ...

  4. JAVA入门[23]-SpringBoot配置Swagger2

    一.新建SpringBoot站点 1.新建module,然后引入pom依赖: <parent> <groupId>org.springframework.boot</gr ...

  5. Python3自定义日志类教程

    一.说明 Python3的logging功能是比较丰富的支持不同层次的日志输出,但或是我们想在日志前输出时间.或是我们想要将日志输入到文件,我们还是想要自定义日志类. 之前自己也尝试写过但感觉文档太乱 ...

  6. Oracle单机Rman笔记[6]---记一次oracle脱机异地还原

    系统情况介绍 正式环境:windows 2008 r2-32bit/ Oracle: Release 11.2.0.1.0 目标环境:windows 2012 Standard-64bit / Ora ...

  7. springMVC的配置与使用

    springMVC的配置与使用 spring mvc 核心类与接口 先来了解一下,几个重要的接口与类.现在不知道他们是干什么的没关系,先混个脸熟,为以后认识他们打个基础. DispatcherServ ...

  8. shogun docker image 中import shogun error

  9. 机器学习sklearn

    sklearn相关模块导入 from sklearn.feature_extraction import DictVectorizer from sklearn.feature_extraction. ...

  10. 关于JS 的cookie 操作 与 json 的数据结构 问题

    今天写了一个购物车,由于购物车内容是保存在 cookie中 所以不想浪费服务器资源做cookie的操作 故在前端封装了一些对象来处理购物车,由于cookie的数据结构的设计是一个json格式 使用 账 ...