神州数码交换机配置实验.docx
《神州数码交换机配置实验.docx》由会员分享,可在线阅读,更多相关《神州数码交换机配置实验.docx(10页珍藏版)》请在冰点文库上搜索。
神州数码交换机配置实验
神州数码交换机配置实验
神州数码交换机配置命令
Telnet远程Shell管理
•设置交换机IP地址
–Switch(config)#interfacevlan1
–Switch(config-If-Vlan1)#ipaddress10.1.1.1255.255.255.0
–Switch(config-If-Vlan1)#noshutdown
•交换机设置Telnet授权用户和口令;若交换机没有设置授权Telnet用户,则任何用
户都无法进入交换机的CLI配置界面。
–Switch(config)#telnet-usertestpassword0testHTTP远程图形管理
•设置交换机IP地址
–Switch(config)#interfacevlan1
–Switch(config-If-Vlan1)#ipaddress10.1.1.1255.255.255.0
–Switch(config-If-Vlan1)#noshutdown
•交换机启动HTTPServer功能
–Switch(config)#iphttpserver
•交换机设置Web授权用户和口令;若交换机没有设置授权Web用户,则任何用户
都无法进入交换机的Web配置界面。
–Switch(config)#web-usertestpassword0testSSH配置
•Switch(Config)#ssh-usertestpassword0test•Switch(Config)#ssh-serverenable
VLAN的基本配置
•划分VLAN100和VLAN200,并加入端口;
–Switch(Config)#vlan100
–Switch(Config-Vlan100)#switchportinterfacee0/0/1-5
–Switch(Config)#vlan200
–Switch(Config-Vlan200)#switchportinterfacee0/0/6-10•配置0/0/24端口为级联端口
–Switch(Config)#interfaceethernet0/0/24
–Switch(Config-ethernet0/0/24)#switchportmodetrunk
–switchporttrunkallowedvlan100;200
–/#Trunk端口缺省允许通过所有VLAN;用户可以通过上述命令设置哪些VLAN
的流量可以通过Trunk口,没有包含的VLAN流量则被禁止。
•察看配置:
showvlan
利用三层交换机实现VLAN间路由
•为VLAN接口设置IP地址;
–Switch(Config)#interfacevlan100
–Switch(Config-If-Vlan100)#ipaddress192.168.1.1255.255.255.0
–Switch(Config)#interfacevlan200
–Switch(Config-If-Vlan200)#ipaddress192.168.2.1255.255.255.0
Switch-1的配置
•hostnameSwitch-1
•interfaceethernet0/0/1-2
–port-group1modeon
•vlan100
–switchportinterfaceethernet0/0/16-20•vlan200
–switchportinterfaceethernet0/0/6-10•vlan300
–switchportinterfaceethernet0/0/11-15•interfaceport-channel1
–switchportmodetrunk
–switchporttrunkallowedvlan100;200;300
Switch-2的配置
•hostnameSwitch-2
•interfaceethernet0/0/1-2
–port-group2modeon
•vlan100
–switchportinterfaceethernet0/0/16-20•vlan200
–switchportinterfaceethernet0/0/6-10•vlan400
–switchportinterfaceethernet0/0/11-15•interfaceport-channel2
–switchportmodetrunk
–switchporttrunkallowedvlan100;200;400
Switch的二层配置
•interfaceethernet0/0/1-2
–port-group1modeon
•interfaceethernet0/0/3-4
–port-group2modeon
•vlan100
•vlan200
•vlan300
•vlan400
•vlan500
–switchportinterfaceethernet0/0/11-15
•interfaceport-channel1
–switchportmodetrunk
–switchporttrunkallowedvlan100;200;300
•interfaceport-channel2
–switchportmodetrunk
–switchporttrunkallowedvlan100;200;400Switch三层配置
•interfacevlan100
–ipaddress192.168.10.1255.255.255.0
•interfacevlan200
–ipaddress192.168.20.1255.255.255.0
•interfacevlan300
–ipaddress192.168.30.1255.255.255.0
•interfacevlan400
–ipaddress192.168.40.1255.255.255.0
•interfacevlan500
–ipaddress192.168.50.1255.255.255.0
三层交换机中三层接口的创建
要将某一个端口设定为三层端口,需要将它加入到某一个VLAN中,然后为该VLAN设置IP地址
Vlan100
Intf0/4
Switchportaccessvlan100
Intvlan100
Ipaddress11.1.1.1255.255.255.0
Noshutdown
DHCP的配置
Switch(Config)#Servicedhcp启动/关闭DHCP服务
Switch(Config)#ipdhcppoolA
Switch(dhcp-A-config)#network10.16.1.024Switch(dhcp-A-config)#lease31032Switch(dhcp-A-config)#default-route10.16.1.20010.16.1.201
Switch(dhcp-A-config)#dns-server10.16.1.202
Switch(dhcp-A-config)#exit
Switch(Config)#ipdhcpexcluded-address10.16.1.20010.16.1.201
二层交换机端口安全配置
设置静态一一映射:
Mac-adderess-tablestaticaddress22-22-22-22-22-22-22vlan10intf0/3设置安全端口地址:
Intf0/3
Switchportport-security
Switchportport-securitymac-address22-22-22-22-22-22