最新消息:阿啰哈,本人90后,目前单身,欢迎妹子们来撩!.(。→‿←。) 微信:frank01991

思科交换机简单配置

Cisco 林志斌 1009浏览

很久没玩思科交换机了,有一种熟悉的味道……
以下是根据我的实际需要所做的配置,切勿盲目模仿,否则后果自负

关闭spanning-tree
IT.Office(config)#no spanning-tree vlan 1-4094

关闭vtp
IT.Office(config)#vtp mode transparent

关闭cdp
IT.Office(config)#no cdp run
双重保险,所有接口禁止启用cdp
IT.Office(config)#int ran g0/1-24
IT.Office(config-if-range)#no cd en

telnet使用本地用户名密码登陆,日志同步输出,15分钟终端超时
IT.Office(config)#line vty 0 4
IT.Office(config-line)#login lo
IT.Office(config-line)#logg syn
IT.Office(config-line)#exec-t 15
IT.Office(config-line)#exi
IT.Office(config)#username admin privilege 15 password admin
    
注意全局密码加密:service password-encryption(此处略)

整个配置如下:
IT.Office#sh ru
Building configuration...

Current configuration : 4478 bytes
!
version 12.2
no service pad
service timestamps debug datetime localtime
service timestamps log datetime localtime
no service password-encryption
!
hostname IT.Office
!
!
username admin privilege 15 password 0 admin
no aaa new-model
system mtu routing 1500
vtp mode transparent
ip subnet-zero
!
no ip domain-lookup
!
!
!
no file verify auto
!         
spanning-tree mode pvst
spanning-tree extend system-id
no spanning-tree vlan 1-4094
!
vlan internal allocation policy ascending
!
vlan 123-124 
!
interface GigabitEthernet0/1
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/2
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/3
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/4
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/5
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/6
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/7
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/8
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/9
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/10
 description kashu.org_Network_Only
 switchport access vlan 123
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/11
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/12
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!         
interface GigabitEthernet0/13
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/14
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/15
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/16
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/17
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/18
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/19
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/20
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 duplex full
 no cdp enable
!
interface GigabitEthernet0/21
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 no cdp enable
!
interface GigabitEthernet0/22
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 no cdp enable
!
interface GigabitEthernet0/23
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 no cdp enable
!
interface GigabitEthernet0/24
 description Guestroom_Network_Only
 switchport access vlan 124
 switchport mode access
 no cdp enable
!
interface Vlan1
 no ip address
 no ip route-cache
 shutdown
!
interface Vlan123
 description kashu.org_MGMT_1.1.1.1/25
 ip address 1.1.1.1 255.255.255.192
 no ip route-cache
!
interface Vlan124
 description Guestroom_MGMT_1.1.1.254/25
 ip address 1.1.1.254 255.255.255.192
 no ip route-cache
!
no ip http server
no cdp run
!
control-plane
!
banner motd ^CIT Office Use Only^C
!
line con 0
 logging synchronous
line vty 0 4
 exec-timeout 15 0
 logging synchronous
 login local
line vty 5 15
 login
!
end

转载请注明:林志斌 » 思科交换机简单配置

发表评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址