网络通信 频道

实战:为交换机配置VLAN网络

  (二)CISCO2950交换机的配置

  Catalyst 2950 (Catalyst 2950G-48 Switch)

  Cat2950#show running-config
  Building configuration...

  Current configuration : 2883 bytes
  !
  version 12.1
  no service single-slot-reload-enable
  no service pad
  service timestamps debug uptime
  service timestamps log uptime
  no service password-encryption
  !
  hostname Cat2950
  !
  ip subnet-zero
  !
  spanning-tree extend system-id
  !
  interface FastEthernet0/1
  no ip address
  !

  !--- Output suppressed.

  interface FastEthernet0/16
  no ip address
  !
  interface FastEthernet0/17
  description SERVER_2
  switchport access vlan 3
  switchport mode access
  no ip address
  spanning-tree portfast
  ! fa0/17是连接服务器_2的端口,属于VLAN3,而且设置为“spanning-tree portfast”模式

  !--- Output suppressed.
  !
  interface FastEthernet0/33
  description HOST_1

  !--- Configure HOST_1 to be the user VLAN, VLAN 2. fa0/33端口接入了用户主机_1所以设置为VLAN2

  switchport access vlan 2
  switchport mode access
  no ip address
  spanning-tree portfast
  !
  !--- Output suppressed.

  interface GigabitEthernet0/1
  switchport trunk encapsulation dot1q
  no ip address
  ! 因为端口g0/1是上连到CISCO3550交换机的,所以设置为TRUNK模式
  interface GigabitEthernet0/2
  no ip address
  !
  interface Vlan1
  no ip address
  no ip route-cache
  shutdown
  !
  interface Vlan10
  description MANAGEMENT

  !--- This IP address manages this switch.  (VLAN10是管理VLAN)

  ip address 10.1.10.2 255.255.255.0
  no ip route-cache
  !

  !--- Configure the default gateway so that the switch is reachable from other
  !--- VLANs/subnets. The gateway points to the VLAN 10 interface on the 3550.

  ip default-gateway 10.1.10.1
  ip http server
  !
  line con 0
  line vty 5 15
  !
  End

0
相关文章