#
version 520, Release 6305P03
#
sysname S7503E_master
#
voice vlan 52 enable
voice vlan aging 100
#
dhcp relay server-group 1 ip 19216812
#
domain default enable system
#
telnet server enable
#
switch-mode standard-routing
#
vlan 1
#
vlan 2 to 22
#
vlan 52
#
vlan 100
#
vlan 888
#
ftth
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
dhcp server ip-pool 1
network 19216810 mask 2552552550
gateway-list 1921681254
#
dhcp server ip-pool 2
network 172150 mask 2552552550
gateway-list 17215254
#
local-user admin
password simple admin
service-type telnet
level 3
#
stp mode rstp
stp instance 0 root primary
stp enable
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan all
#
interface NULL0
#
interface Vlan-interface1
ip address 1921681253 2552552550
vrrp vrid 1 virtual-ip 1921681254
vrrp vrid 1 priority 110
#
interface Vlan-interface2
description bianjiewangluo
ip address 17212253 2552552550
vrrp vrid 2 virtual-ip 17212254
vrrp vrid 2 priority 110
#
interface Vlan-interface3
description zixunbu
ip address 17213253 2552552550
vrrp vrid 3 virtual-ip 17213254
vrrp vrid 3 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface4
description kaoqinshebei
ip address 17214253 2552552550
vrrp vrid 4 virtual-ip 17214254
vrrp vrid 4 priority 110
#
interface Vlan-interface5
description wuxian_A
ip address 17215253 2552552550
vrrp vrid 5 virtual-ip 17215254
vrrp vrid 5 priority 110
#
interface Vlan-interface6
description wuxian_B
ip address 17216253 2552552550
vrrp vrid 6 virtual-ip 17216254
vrrp vrid 6 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface17
description 17F
ip address 172117253 2552552550
vrrp vrid 17 virtual-ip 172117254
vrrp vrid 17 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface18
description 18F
ip address 172118253 2552552550
vrrp vrid 18 virtual-ip 172118254
vrrp vrid 18 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface19
description 19F
ip address 172119253 2552552550
vrrp vrid 19 virtual-ip 172119254
vrrp vrid 19 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface20
description 20F
ip address 172120253 2552552550
vrrp vrid 20 virtual-ip 172120254
vrrp vrid 20 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface21
description 21F
ip address 172121253 2552552550
vrrp vrid 21 virtual-ip 172121254
vrrp vrid 21 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface22
description 22F
ip address 172122253 2552552550
vrrp vrid 22 virtual-ip 172122254
vrrp vrid 22 priority 110
dhcp select relay
dhcp relay server-select 1
#
interface Vlan-interface52
description voice_vlan
ip address 172160253 25525500
vrrp vrid 52 virtual-ip 1721601
vrrp vrid 52 priority 110
dhcp select relay
dhcp relay server-select 1
发我以前配置过的,你自己研究一下
三层交换机是不是经常让你机器不好使,看看下面的三层交换机配置文章,一切问题都能解决。本文详细介绍实例讲解:全面的三层交换机配置比较全面的三层交换机配置实例,带命令解释哟!
三层交换机配置:
Enable //进入私有模式
Configure terminal //进入全局模式
service password-encryption //对密码进行加密
hostname Catalyst 3550-12T1 //给三层交换机定义名称
enable password 123456 //enable密码
Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样)
Ip subnet-zero //允许使用全0子网(默认都是打开的)
Ip name-server 1721681 1721682 //三层交换机名字Catalyst 3550-12T1对应的IP地址是1721681
Service dhcp //提供DHCP服务
ip routing //启用三层交换机上的路由模块
Exit
三层交换机配置:
Vtp mode server //定义VTP工作模式为sever模式
Vtp domain centervtp //定义VTP域的名称为centervtp
Vlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002)
Vlan 3 name vlan3
Vlan 4 name vlan4
Vlan 5 name vlan5
Vlan 6 name vlan6
Vlan 7 name vlan7
Vlan 8 name vlan8
Vlan 9 name vlan9
Exit
三层交换机配置:
interface Port-channel 1 //进入虚拟的以太通道组1
switchport trunk encapsulation dot1q //给这个接口的trunk封装为8021Q的帧格式
switchport mode trunk //定义这个接口的工作模式为trunk
switchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过
Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1
switchport trunk encapsulation dotlq //给这个接口的trunk封装为8021Q的帧格式
switchport mode trunk //定义这个接口的工作模式为trunk
switchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过
channel-group 1 mode on //把这个接口放到快速以太通道组1中
Interface gigabitethernet 0/2 //同上
switchport trunk encapsulation dotlq
switchport mode trunk
switchport trunk allowed vlan all
channel-group 1 mode on
三层交换机配置:
port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依源和目的IP的方式)
interface gigabitethernet 0/3 //进入模块0上的吉比特以太口3
switchport trunk encapsulation dotlq //给trunk封装为8021Q
switchport mode trunk //定义这个接口的工作模式为trunk
switchport trunk allowed vlan all //允许所有vlan信息通过
interface gigabitethernet 0/4 //同上
switchport trunk encapsulation dotlq
switchport mode trunk
switchport trunk allowed vlan all
interface gigbitethernet 0/5 //同上
switchport trunk encapsulation dotlq
switchport mode trunk
switchport trunk allowed vlan all
interface gigbitethernet 0/6 //同上
switchport trunk encapsulation dotlq
switchport mode trunk
switchprot trunk allowed vlan all
三层交换机配置:
interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7
Switchport mode access //定义这个接口的工作模式为访问模式
switchport access vlan 9 //定义这个接口可以访问哪个vlan(实际就是分配这个接口到vlan)
no shutdown
spanning-tree vlan 6-9 cost 1000 //在生成树中,vlan6-9的开销定义为10000
interface range gigabitethernet 0/8 – 10 //进入模块0上的吉比特以太口8,9,10
switchport mode access //定义这些接口的'工作模式为访问模式
switchport access vlan 8 //把这些接口都分配到vlan8中
no shutdown
三层交换机配置:
spanning-tree portfast //在这些接口上使用portfast(使用portfast以后,在生成树的时候不参加运算,直接成为转发状态)
interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11
switchport trunk encapsulation dotlq //给这个接口封装为8021Q
switchport mode trunk //定义这个接口的工作模式为trunk
switchport trunk allowed vlan all //允许所有vlan信息通过
interface gigabitethernet 0/12 //同上
switchport trunk encapsulation dotlq
switchport mode trunk
switchport trunk allowed vlan all
interface vlan 1 //进入vlan1的逻辑接口(不是物理接口,用来给vlan做路由用)
ip address 1721617 2552552550 //配置IP地址和子网掩码
no shutdown
三层交换机配置:
standby 1 ip 1721619 //开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为1721619
standby 1 priority 110 preempt //定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式
interface vlan 2 //同上
ip address 172162252 2552552550
no shutdown
standby 2 ip 172162254
standby 2 priority 110 preempt
ip access-group 101 in //在入方向上使用扩展的访问控制列表101
interface vlan 3 //同上
ip address 172163252 2552552550
no shutdown
三层交换机配置:
standby 3 ip 172163254
standby 3 priority 110 preempt
ip access-group 101 in
interface vlan 4 //同上
ip address 172164252 2552552550
no shutdown
standby 4 ip 172164254
standby 4 priority 110 preempt
ip access-group 101 in
interface vlan 5
ip address 172165252 2552552550
no shutdown
standby 5 ip 172165254
standby 5 priority 110 preempt
ip access-group 101 in
interface vlan 6
ip address 172166252 2552552550
no shutdown
三层交换机配置:
standby 6 ip 172166254
standby 6 priority 100 preempt
interface vlan 7
ip address 172167252 2552552550
no shutdown
standby 7 ip 172167254
standby 7 priority 100 preempt
interface vlan 8
ip address 172168252 2552552550
no shutdown
standby 8 ip 172168254
standby 8 priority 100 preempt
interface vlan 9
ip address 172169252 2552552550
no shutdown
三层交换机配置:
standby 9 ip 172169254
standby 9 priority 100 preempt
access-list 101 deny ip any 1721670 000255 //扩展的访问控制列表101
access-list 101 permit ip any any
Interface vlan 1 //进入vlan1这个逻辑接口
Ip helper-address 1721681 //可以转发广播(helper-address的作用就是把广播转化为单播,然后发向1721681)
Interface vlan 2
Ip helper-address 1721681
Interface vlan 3
ip helper-address 1721681
interface vlan 4
ip helper-address 1721681
interface vlan 5
ip helper-address 1721681
interface vlan 6
ip helper-address 1721681
interface vlan 7
ip helper-address 1721681
interface vlan 9
ip helper-address 1721681
router rip//启用路由协议RIP
version 2//使用的是RIPv2,如果没有这句,则是使用RIPv1
network 1721600//宣告直连的网段
exit
三层交换机配置:
ip route 0000 0000 172169250//缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172169250这个路由器
line con 0
line aux 0
line vty 0 15//telnet线路(路由器只有5个,是0-4)
password 12345678//login密码
login
end
copy running-config startup-config 保存配置
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)