能帮我写个交换机自动配置模板吗
时间: 2023-09-03 15:06:53 浏览: 30
当然可以,以下是一个基本的交换机自动配置模板:
```
! --- Enable SSH and Telnet access ---
ip domain-name yourdomain.com
crypto key generate rsa modulus 2048
username admin privilege 15 password 0 yourpassword
line vty 0 15
transport input ssh telnet
login local
! --- Configure VLANs ---
vlan 10
name Management
vlan 20
name Sales
vlan 30
name Engineering
! --- Assign VLANs to switch ports ---
interface GigabitEthernet1/0/1
switchport access vlan 10
interface GigabitEthernet1/0/2
switchport access vlan 20
interface GigabitEthernet1/0/3
switchport access vlan 30
! --- Configure trunk port ---
interface GigabitEthernet1/0/24
switchport mode trunk
switchport trunk allowed vlan 10,20,30
! --- Configure Link Aggregation Control Protocol (LACP) ---
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 10,20,30
channel-group 1 mode active
interface GigabitEthernet1/0/4
channel-group 1 mode active
interface GigabitEthernet1/0/5
channel-group 1 mode active
! --- Configure spanning tree protocol (STP) ---
spanning-tree mode rapid-pvst
spanning-tree vlan 10,20,30 root primary
! --- Configure Quality of Service (QoS) ---
class-map match-all VOICE
match access-group 101
policy-map QOS
class VOICE
priority percent 50
class class-default
fair-queue
access-list 101 permit udp any any range 16384 32767
! --- Configure Network Time Protocol (NTP) ---
ntp server yourntpserveripaddress
! --- Configure Simple Network Management Protocol (SNMP) ---
snmp-server community yourcommunitystring RO
```
你可以根据自己的需求和网络环境进行修改和定制。