神州数码交换机配置
- 格式:doc
- 大小:22.50 KB
- 文档页数:2
神州数码交换机路由器命令神州数码交换机路由器命令交换机配置命令switch>en (enable)进入特权用户模式switch # conf (config) 进入全局配置模式switch (config)# int e0/0/1 进入接口配置模式switch (config)# int vlan 1 进入VLAN配置模式switch (config)# host (hostname) 配置交换机名称switch (config)# enable password 1234 配置交换机密码switch (config)# enable password 8 1234 配置交换机密码(加密)switch (config)# vlan 10 创建vlanswitch (config)# int vlan 10switch (config-If-Vlan10)# ip address 172.16.10.1 255.255.255.0 配置VLAN地址生成树技术Switch (config)# spanning-tree 启用全局生成树(默认mstp生成树技术)switch (config)# spanning-tree mode stp/rstp/mstp 生成树技术switch (config)# spanning-tree mst 0 port-priority 4096 设置交换机的优先级默认32768Switch# sh sp (show spanning-tree) 查看生成树交换机Web管理switch (config)# ip http serverswitch (config)# web-user admin password 0 1234 用户名和密码(命令要全写)交换机T elnet管理switch (config) # ip http serverswitch (config)# telnet-user admin password 0 1234 用户名和密码(命令要全写)清空交换机配置switch# set def (default)恢复出厂配置switch# wr (write)保存配置switch# rel (reload)重启交换机链路聚合(不需启动生成树)switchA(config)# port-group 1switchA(config)# int e0/0/1-2switchA(config-port-range)# port-group 1 mode on/active 手动配置/自动配置switchA(config)# no port-group 1 删除组1switchB(config) # port-group 2switchB(config) # int e0/0/3-4switchB(config-port-range) # port-group 2 mode on/active switchA(config) # no port-group 2 删除组2交换机MAC与IP绑定switch (config)# am enable 启用全局am功能switch (config)# int e0/0/1switch (config_if_ethernet0/0/1)# am port 打开端口am功能switch (config_if_ethernet0/0/1)# am mac-ip-pool 00-A0-D1-D1-07-FF 192.168.1.101交换机DHCP服务器配置switch (config)# service dhcp 启用DHCPswitch (config)# ip dhcp pool poolA 定义地址池poolAswitch (dhcp-poolA- config)# network-address 192.168.1.0 24switch (dhcp-poolA- config)# lease 3 租期3天switch (dhcp-poolA- config)# default-router 192.168.1.1 网关switch (dhcp-poolA- config)# dns-server 60.191.244.5 DNS服务器ACL访问控制列表switchA(config)# ip access-list standard test 命名标准IP访问列表switchA(config-std-nacl-test)# deny 192.168.100.0 0.0.0.255 反子网掩码switchA(config-std-nacl-test)# deny 192.168.200.0 0.0.0.0switchA(config) # firewall enable 开启ACL功能switchA(config)# firewall default permit/deny 默认permit允许switchA(config)# int e0/0/1switchA(config-if-interface0/0/1) # ip access-group test in/outswitchA(config) # ip access-list standard 10 数字标准IP访问列表配置时间范围switchA(config)#time-range worktimeswitchA(config-time-range)#absolute-periodic weekdays 09:00:00 to 18:00:00路由器配置命令Router>ena 进入特权用户模式 Router# conf 进入全局配置模式Router_config# int f0/0Router_config_f0/0# ip address 10.1.1.1 255.255.255.0 配置路由器端口地址清空路由器配置Router# del (delete)删除启动配置文件Router# reb (reboot) 重启路由器静态路由Router_config# ip route 10.1.2.0 (目标网段) 255.255.255.0(子网掩码) 10.1.1.1 (转发地址)默认静态路由Router_config# ip route 0.0.0.0 (目标网段) 0.0.0.0(子网掩码)10.1.1.1 (转发地址)RIP动态路由Router_config# router rip 启用RIP路由Router_config_rip# version 2 RIP路由版本号 2Router_config_rip# network 10.1.1.0 255.255.255.0Router_config_rip# network 10.1.2.0 255.255.255.0 与路由器相连的网段OSPF动态路由Router_config# router ospf 1 启动ospf进程,进程号为1Router_config_ospf1# network 10.1.1.0 255.255.255.0 area 0 网段、子网掩码和区域号Router_config_ospf1# network 10.1.2.0 255.255.255.0 area 0 第一个区域(即主干区域)区域号为 0Router# show ip route 查看路由。
神州数码交换机Vlan配置命令VLAN配置命令8.2.2.1 vlan命令:vlan [vlan-id]no vlan [vlan-id]功能:创建vlan 并且进入vlan 配置模式,在vlan 模式中,用户可以配置vlan 名称和为该vlan 分配交换机端口;本命令的no 操作为删除指定的vlan。
参数:[vlan-id]为要创建/删除的vlan 的vid,取值范围为1~4094。
命令模式:全局配置模式缺省情况:交换机缺省只有vlan1。
使用指南:vlan1 为交换机的缺省vlan,用户不能配置和删除vlan1。
允许配置vlan的总共数量为4094 个。
另需要提醒的是不能使用本命令删除通过gvrp 学习到的动态vlan。
举例:创建vlan100,并且进入vlan100 的配置模式。
switch (config)#vlan 100switch (config-vlan100)#8.2.2.2 name命令:name [vlan-name]no name功能:为vlan 指定名称,vlan 的名称是对该vlan 一个描述性字符串;本命令的no 操作为删除vlan 的名称。
参数:[vlan-name]为指定的vlan 名称字符串。
命令模式:vlan 配置模式缺省情况:vlan 缺省名称为vlanxxx,其中xxx 为vid。
使用指南:交换机提供为不同的vlan 指定名称的功能,有助于用户记忆vlan,方便管理。
举例:为vlan100 指定名称为testvlan。
switch (config-vlan100)#name testvlan8.2.2.3 switchport access vlan命令:switchport access vlan [vlan-id]no switchport access vlan功能:将当前access 端口加入到指定vlan;本命令no 操作为将当前端口从vlan 里删除。
神州数码交换机基本配置恢复交换机的出厂设置命令:set default功能:恢复交换机的出厂设置。
命令模式:特权用户配置模式。
使用指南:恢复交换机的出厂设置,即用户对交换机做的所有配置都消失,用户重新启动交换机后,出现的提示与交换机首次上电一样。
注意:配置本命令后,必须执行write 命令,进行配置保留后重启交换机即可使交换机恢复到出厂设置。
举例:Switch#set defaultAre you sure? [Y/N] = ySwitch#writeSwitch#reload进入交换机的Setup配置模式命令:setup功能:进入交换机的Setup配置模式。
命令模式:特权用户配置模式。
使用指南:在Setup配置模式下用户可进行IP地址、Web 服务等的配置。
举例:Switch#setupSetup Configuration---System Configuration Dialog---At any point you may enter Ctrl+C to exit.Default settings are in square brackets [ ].If you don't want to change the default settings, you can input enter.Continue with configuration dialog? [y/n]:yPlease select language[0]:English[1]:中文Selection(0|1) [0]:0Configure menu[0]:Config hostname[1]:Config interface-Vlan1[2]:Config telnet-server[3]:Config web-server[4]:Config SNMP[5]:Exit setup configuration without saving[6]:Exit setup configuration after saving配置交换机IP 地址首先配置主机的IP地址,要与交换机的VLAN1 接口IP地址在同一个网段。
神州数码交换机配置命令Telnet远程Shell管理•设置交换机IP地址–Switch(config)#interface vlan 1–Switch(config-If-Vlan1)#ip address 10.1.1.1 255.255.255.0–Switch(config-If-Vlan1)#no shutdown•交换机设置Telnet授权用户和口令;若交换机没有设置授权Telnet用户,则任何用户都无法进入交换机的CLI配置界面。
–Switch(config)#telnet-user test password 0 testHTTP远程图形管理•设置交换机IP地址–Switch(config)#interface vlan 1–Switch(config-If-Vlan1)#ip address 10.1.1.1 255.255.255.0–Switch(config-If-Vlan1)#no shutdown•交换机启动HTTP Server功能–Switch(config)#ip http server•交换机设置Web授权用户和口令;若交换机没有设置授权Web用户,则任何用户都无法进入交换机的Web配置界面。
–Switch(config)#web-user test password 0 testSSH配置•Switch(Config)#ssh-user test password 0 test•Switch(Config)#ssh-server enableVLAN的基本配置•划分VLAN 100和VLAN 200,并加入端口;–Switch(Config)#vlan 100–Switch(Config-Vlan100)#switchport interface e0/0/1-5–Switch(Config)#vlan 200–Switch(Config-Vlan200)#switchport interface e0/0/6-10•配置0/0/24端口为级联端口–Switch(Config)#interface ethernet 0/0/24–Switch(Config-ethernet0/0/24)#switchport mode trunk–switchport trunk allowed vlan 100;200–/#Trunk端口缺省允许通过所有VLAN;用户可以通过上述命令设置哪些VLAN 的流量可以通过Trunk口,没有包含的VLAN流量则被禁止。
神州数码交换机配置神州数码交换机配置基本命令交换机基本状态:hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir Flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息完了最最要的一步。
神州数码交换机路由器配置命令神州数码交换机路由器配置命令章节一:引言⑴文档目的本文档旨在提供神州数码交换机路由器的详细配置命令,以指导管理员进行设备的初始化和配置。
⑵背景神州数码交换机路由器是一种用于数据传输的网络设备,拥有多种功能和特性。
本文档将介绍如何使用各种命令来配置交换机路由器的不同功能。
⑶受众本文档适用于所有需要配置神州数码交换机路由器的管理员和网络工程师。
章节二:初始化设备⑴登录设备使用如下命令登录设备:`login`⑵修改设备密码使用如下命令修改设备密码:`configure terminalenable secret [password]`章节三:基本配置⑴设置主机名使用如下命令设置设备的主机名:`configure terminalhostname [hostname]`⑵配置IP地质使用如下命令配置设备的IP地质:`configure terminalinterface [interface]ip address [ip-address] [subnet-mask]`⑶设置默认网关使用如下命令设置设备的默认网关:`configure terminalip default-gateway [gateway-address]`章节四:VLAN配置⑴创建VLAN使用如下命令创建一个新的VLAN:`configure terminalvlan [vlan-id]name [vlan-name]`⑵将接口加入VLAN使用如下命令将接口加入指定的VLAN:`configure terminalinterface [interface]switchport mode accessswitchport access vlan [vlan-id]`章节五:路由配置⑴静态路由使用如下命令配置静态路由:`configure terminalip route [destination-network] [subnet-mask] [next-hop]`⑵动态路由使用如下命令配置动态路由协议:`configure terminalrouter [routing-protocol]network [network-address] [subnet-mask]`章节六:安全配置⑴访问控制列表(ACL)使用如下命令配置ACL:`configure terminalaccess-list [acl-number] [permit----deny] [source] [destination] [protocol]`⑵端口安全使用如下命令配置端口安全:`configure terminalinterface [interface]switchport mode accessswitchport port-securityswitchport port-security maximum [max] switchport port-security violation [mode]`章节七:QoS配置⑴优先级队列使用如下命令配置优先级队列:`configure terminalinterface [interface]priority-queue out`⑵带宽限制使用如下命令配置带宽限制:`configure terminalinterface [interface]bandwidth [rate]`章节八:设备管理⑴ NTP服务使用如下命令启用NTP服务:`configure terminalntp server [server-address]`⑵ Telnet和SSH访问使用如下命令配置Telnet和SSH访问:`configure terminalline vty 0 15transport input telnet ssh`⑶登录Banner使用如下命令配置登录Banner:`configure terminalbanner login [banner-text]`附录:本文档涉及附件附件1:设备配置备份说明附录:法律名词及注释⒈ACL:访问控制列表,用于控制网络流量的访问权限。
神州数码交换机路由器配置命令神州数码交换机路由器配置命令文档范本1.系统配置1.1 登录路由器进入路由器登录界面,输入用户名和密码进行身份验证。
1.2 修改密码修改默认密码以确保安全性,并避免未经授权访问。
1.3 系统时间设置设置路由器系统时间,以确保日志记录和其他时间相关功能的正确运行。
2.接口配置2.1 查看接口信息查看路由器上各个接口的状态信息,包括接口编号、MAC地质、速率等。
2.2 配置接口IP地质为路由器上的接口分配一个唯一的IP地质,以便在网络中进行通信。
3.静态路由配置3.1 添加静态路由添加路由器的静态路由表,将目的网络与下一跳的出接口进行绑定。
3.2 删除静态路由删除不再需要的静态路由表项,以避免冗余和失效路由的影响。
4.动态路由配置4.1 配置动态路由协议配置常见的路由协议,如OSPF、BGP等,使路由器能够通过动态协议学习和更新路由表。
4.2 配置路由器之间的邻居关系配置路由器之间的邻居关系,并通过协议交换路由信息。
5.QoS配置5.1 配置带宽限制对指定的流量进行带宽限制,以确保网络资源的公平分配。
5.2 配置流量分类根据不同的流量类型,进行分类和标记,以便在网络中进行优先处理。
6.安全配置6.1 ACL配置配置访问控制列表(ACL),限制网络中某些主机或网络的访问权限。
6.2 配置防火墙配置防火墙规则,控制网络流量的进出。
7.网络管理配置7.1 配置SNMP配置简单网络管理协议(SNMP),以便对路由器进行监控和管理。
7.2 配置日志记录配置路由器的日志记录功能,记录重要的系统事件和错误信息。
8.附件本文档附带了相关的配置示例和常见问题解答。
9.法律名词及注释在本文档中所涉及的法律名词和相关注释的完整列表。
神州数码交换机“链路聚合”配置交换机A配置:SwitchA(config)#port-group 1 (创建1个链路聚合组)1代表的是组号,可随意写,但必须与下面的聚合组的组号一致SwitchA(config)#internet ethernet 0/0/1-2(进入端口0/0/1-2)SwitchA(config-if-port-range)#port-group 1mode on/active/passive(手动/主动/被动)(将端口加入链路聚合组并选择模式)SwitchA(config)#internet port-channel 1(进入链路聚合组1)SwitchA(config-if-port-channel)#switchport mode trunk (将链路聚合组开启Trunk模式)交换机B配置:SwitchB(config)#port-group 1 (创建1个链路聚合组)1代表的是组号,可随意写,但必须与下面的聚合组的组号一致SwitchB(config)#internet ethernet 0/0/1-2(进入端口0/0/1-2)SwitchB(config-if-port-range)#port-group 1mode on/active/passive(手动/主动/被动)(将端口加入链路聚合组并选择模式)SwitchB(config)#internet port-channel 1(进入链路聚合组1)SwitchB(config-if-port-channel)#switchport mode trunk (将链路聚合组开启Trunk模式)注:配置链路聚合时先创建组和选择模式后在插线,连接网线后在配置最后一步(开启Trunk模式)二层交换与三层交换做链路聚合时只能选择手动模式(on)二层与二层或三层与三层做链路聚合时,选用主动模式和被动模式,一端为主动“active”时,另一端为被动“passive”交换机A与交换机B配置一致,不同的地方就是选择模式如果做多条链路聚合时可创建多个聚合组。
第一部分交换机配置一、基础配置1、模式进入Switch>Switch>enSwitch#configSwitch(Config)#interface ethernet 0/22、配置交换机主机名命令:hostname <主机名>3、配置交换机IP地址Switch(Config)#interface vlan 1Switch(Config-If-Vlan1)#ip address 10.1.128.251 255.255.255.0Switch(Config-If-Vlan1)#no shut4、为交换机设置Telnet授权用户和口令:登录到Telnet的配置界面,需要输入正确的用户名和口令,否则交换机将拒绝该Telnet用户的访问。
该项措施是为了保护交换机免受非授权用户的非法操作。
若交换机没有设置授权Telnet用户,则任何用户都无法进入交换机的Telnet配置界面。
因此在允许Telnet方式配置管理交换机时,必须在Console的全局配置模式下使用命令username <username>privilege <privilege> [password (0 | 7) <password>]为交换机设置Telnet授权用户和口令并使用命令authentication line vty login local打开本地验证方式,其中privilege选项必须存在且为15。
例:Switch>enableSwitch#configSwitch(config)#username test privilege 15 password 0 testSwitch(config)#authentication line vty login localSwitch(Config)#telnet-user test password 0 testSwitch (Config)#telnet-server enable://启动远程服务功能5、配置允许Telnet管理交换机的地址限制(单独IP或IP地址段)(1)限制单个IP允许Telnet登录交换机switch(config)#authentication security ip 192.168.1.2(2)限制允许IP地址段Telnet登录交换机switch(config)#access-list 1 permit 192.168.1.0 0.0.0.255switch(config)#authentication ip access-class 1 in5、为交换机设置Web授权用户和口令:web-user <用户名>password {0|7} <密码>例:Switch(Config)#web-user admin password 0 digital6、设置系统日期和时钟:clock set <HH:MM:SS> <YYYY/MM/DD>7、设置退出特权用户配置模式超时时间exec timeout <minutes > //单位为分钟,取值范围为0~3008、保存配置:write9、显示系统当前的时钟:Switch#show clock10、指定登录用户的身份是管理级还是访问级Enable [level {visitor|admin} [<密码>]]11、指定登录配置模式的密码:Enable password level {visitor|admin}12、配置交换机的用户名密码:username admin privilege 15 password 0 admin00013、配置enable密码为ddd:enable password 0 ddd level 1514、配置登录时认证:authentication line vty login local15、设置端口的速率和双工模式(接口配置模式下)命令:speed-duplex {auto | force10-half | force10-full | force100-half | force100-full | {{force1g-half | force1g-full} [nonegotiate [master | slave]] } }no speed-duplex二、单交换机VLAN划分1、VLAN基本配置(1)新建VLAN:vlan <vlan-id>(2)命名VLAN:name <vlan-name>(3)为VLAN 分配交换机端口Switch(Config-If-Vlan1)#switchport interface Ethernet 0/2(4)设置Trunk 端口允许通过VLAN:Switch(Config-ethernet0/0/5)#switchport trunk allowed vlan 1;3;5-202、划分VLAN:(1)进入相应端口:Switch(config)#interface Ethernet 0/2(2)修改模式:Switch(Config-ethernet0/0/5)switchport mode access(3)划分VLAN:Switch(Config-ethernet0/0/5)#switchport access vlan 4三、跨交换机VLAN划分(两台交换机作相同操作)1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk四、VLAN间主机的通信1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk注意:如果是三层交换机,在修改模式先封装802.1协议:Switch(config-if)#switchport trunk encapsulation dot1q4、建立VLAN子接口(1)、进入VLAN接口模式:Switch(config)#interface vlan 2(2)、设置VLAN子接口地址:Switch(config-if)#ip address 192.168.0.1 255.255.255.0 (3)、打开端口:Switch(config-if)#no shutdown5、设置各主机IP地址、子网掩码、网关注意:(1)各主机IP地址应与其所在的VLAN在同一网段。
神州数码交换机配置命令交换机基本状态:hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir Flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息完了最最要的一步。
第7章综合实训7.1 综合实训一1.背景介绍下图为园区网络的拓扑图,网络中使用了两台三层交换机DCRS-5526A和DCRS-5526B 提供内部网络的互联,网络边缘采用了一台路由器DCR-1702用于连接到internet,DCR-2611用于模拟Internet中的路由器。
DCRS-5526A上连接一台PC,PC处于Vlan100中。
DCRS-5526B连接一台FTP服务器和一台打印服务器,两台服务器处于VLAN200中,DCRS-5526A与DCRS-5526B之间使用交换机间链路相连。
DCRS-5526A与DCRS-5526B使用具有三层特性的物理端口与DCR-1702相连。
在internet上有一台与DCR-2611相连的外部Web服务器。
说明:本实验采用的设备均为神州数码公司网络产品。
其中DCRS-5526为三层交换机。
综合实训实验图如图7.1所示。
图7.1 综合实训1实验图为了实现网络资源的共享,需要PC机能够访问内部网络中的FTP服务器,以实现文件的上传和下载,并且PC机需要连接到打印服务器以进行远程的打印操作,PC机需要能够通过园区网络连接到internet的Web服务器,并能够进行Web网页的浏览。
其中各计算机的IP地址及网关配置说明计算机IP 子网掩码网关PC机192.168.100.100 255.255.255.0 192.168.100.1FTP服务器192.168.200.10 255.255.255.0 192.168.200.1打印服务器192.168.200.20 255.255.255.0 192.168.200.1Web服务器100.1.1.2 255.255.255.0 100.1.1.12.具体配置内容和过程(1)在DCRS-5526A与DCRS-5526B上划分VLAN并将PC机与服务器加入到相应的VLAN中。
l在DCRS-5526A上创建VLAN 100,并将e0/0/1加入到VLAN 100中DCRS-5526S#configDCRS-5526S(Config)#hostname DCRS5526ADCRS5526A(Config)#vlan 100DCRS5526A(Config-Vlan100)#switchport interface ethernet 0/0/1DCRS5526A(Config-Vlan100)#exitl在DCRS-5526B上创建VLAN 100,并将e0/0/1、e0/0/2加入到VLAN 200中DCRS-5526S#configDCRS-5526S(Config)#hostname DCRS5526BDCRS5526B(Config)#vlan 200DCRS5526B(Config-Vlan200)#switchport interface ethernet 0/0/1-2DCRS5526B(Config-Vlan200)#exit(2)为DCRS-5526A与DCRS-5526B上的VLAN接口、DCR-1702和DCR-2611的以太网接口配置IP地址。
神州数码交换机路由器常用命令操作神州数码交换机路由器常用命令操作1:登录与退出命令1.1 登录命令在使用神州数码交换机路由器之前,需要登录到设备上才能进行操作。
登录命令通常为:```login username password```其中,username为登录用户名,password为登录密码。
1.2 退出命令当操作完成后,需要退出登录,以防止未经授权的访问。
退出命令通常为:```logout```2:查看与配置接口2.1 查看接口命令可以使用以下命令来查看交换机或路由器上的接口信息: ```show interfaces```该命令将会显示接口的名称、状态、IP地址等信息。
2.2 配置接口命令如果需要配置接口的IP地址,可以使用以下命令: ```interface interface_nameip address ip_address mask```其中,interface_name为接口名称,ip_address和mask为要配置的IP地址和子网掩码。
3:路由配置命令3.1 静态路由配置命令使用以下命令可以配置静态路由:ip route network_address mask next_hop```其中,network_address为目标网络地址,mask为子网掩码,next_hop为下一跳IP地址。
3.2 动态路由配置命令如果需要配置动态路由,可以使用以下命令: ```router ospfnetwork network_address mask area area_id```其中,network_address为本地网络地址,mask为子网掩码,area_id为区域ID。
4:保存与加载配置命令4.1 保存配置命令在对交换机或路由器进行配置后,应该保存配置以防止丢失。
保存配置的命令通常为:write```4.2 加载配置命令如果需要加载已保存的配置,可以使用以下命令:```reload```5:其他常用命令5.1 查看系统信息命令```show version```该命令将显示交换机或路由器的版本信息、启动时间等。
神州数码交换机配置命令交换机基本状态:hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir Flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息完了最最要的一步。
1、公司内部人员不会配置IP地址,在SWA上配置DHCP服务,为PCC与PCB分配IP地址,PCC的地址段为192.168.10.0/24网段,PCB的地址段为192.168.11.0/24网段。
SWA:SWA(config)#service dhcp //启用dhcp服务SWA(config)#ip dhcp pool PC // 定义一个地址池SWA(dhcp-pc-config)#network-address 192.168.10.0 24 //地址段SWA(dhcp-pc-config)#lease 0 8 0 //租用时间8小时SWA(dhcp-pc-config)#default-router 192.168.10.254 //设置默认网关SWA(config)#int vlan 1SWA(config-if-vlan1)#ip address 192.168.10.1 255.255.255.0 //需和地址池同一网段SWA(config)#service dhcp //启用dhcp服务SWA(config)#ip dhcp pool PB // 定义一个地址池SWA(dhcp-pc-config)#network-address 192.168.20.0 24 //地址段SWA(dhcp-pc-config)#lease 0 3 0 //租用时间3小时SWA(dhcp-pc-config)#default-router 192.168.20.254 //设置默认网关2、由于内网用户不会设置IP地址,在内网接入层交换机SWB上设置DHCP服务,方便内网用户的使用。
其中PCC用户会设置IP地址,所以PCC使用静态IP 地址。
设置网段为:192.XX.20.0/24网段。
SWB:SWB(config)#service dhcp //启用dhcp服务SWB(config)#ip dhcp pool PB // 定义一个地址池SWB(dhcp-pc-config)#network-address 192.168.20.0 24 //地址段SWB(dhcp-pc-config)#lease 0 3 0 //租用时间3小时SWB(dhcp-pc-config)#default-router 192.168.20.254 //设置默认网关SWB(config)#int vlan 1SWB(config-if-vlan1)#ip address 192.168.20.254 255.255.255.0 3、为保证内网终端安全,要求内网所有用户的MAC地址与接入交换机SWB接口进行绑定,至少使用两种方法进行绑定。
神州数码路由器及交换机配置命令简介神州数码是一个中国的网络设备制造商。
它提供了多种路由器和交换机产品,包括SOHO、企业和运营商级别的产品。
在这篇文档中,我们将介绍对神州数码路由器及交换机进行配置的基本命令。
这些命令可用于启用和禁用端口、配置具有VLAN的端口以及管理路由和静态路由等。
命令列表所有设备通用命令以下是在所有神州数码路由器和交换机上都可以执行的通用命令。
1. 基本配置enable // 进入特权模式configure terminal // 进入全局配置模式hostname <name> // 配置设备名称banner motd #<message># // 设置登录提示信息interface <interface> // 进入具体端口的配置界面no shutdown // 开启端口shutdown // 关闭端口exit // 退出当前模式show running-config // 显示当前配置write memory // 将当前配置保存到FLASH文件系统中,以便重启后仍然存在2. VLAN 配置vlan <id> // 进入 VLAN 配置模式name <name> // 配置 VLAN 名称exit // 退出 VLAN 配置模式interface <interface> // 进入具体端口的配置界面switchport access vlan <id> // 配置端口所在VLAN号,使端口成为 ACCESS 端口switchport mode trunk // 配置端口为 TRUNK 端口,可同时传输多个 VLA N3. 静态路由ip route <destination_network> <destination_subnet_mask> <next_hop_a ddress> // 添加静态路由show ip route // 显示当前路由表某些设备具有的高级命令以下命令在某些神州数码路由器和交换机上可用。
第一部分交换机配置一、基础配置1、模式进入Switch>Switch>enSwitch#configSwitch(Config)#interface ethernet 0/22、配置交换机主机名命令:hostname <主机名>3、配置交换机IP地址Switch(Config)#interface vlan 1Switch(Config-If-Vlan1)#ip address 10.1.128.251 255.255.255.0Switch(Config-If-Vlan1)#no shut4、为交换机设置Telnet授权用户和口令:登录到Telnet的配置界面,需要输入正确的用户名和口令,否则交换机将拒绝该Telnet用户的访问。
该项措施是为了保护交换机免受非授权用户的非法操作。
若交换机没有设置授权Telnet用户,则任何用户都无法进入交换机的Telnet配置界面。
因此在允许Telnet方式配置管理交换机时,必须在Console的全局配置模式下使用命令username privilege [password (0 | 7) ]为交换机设置Telnet授权用户和口令并使用命令authentication line vty login local打开本地验证方式,其中privilege选项必须存在且为15。
例:Switch>enableSwitch#configSwitch(config)#username test privilege 15 password 0 testSwitch(config)#authentication line vty login localSwitch(Config)#telnet-user test password 0 testSwitch (Config)#telnet-server enable://启动远程服务功能5、配置允许Telnet管理交换机的地址限制(单独IP或IP地址段)(1)限制单个IP允许Telnet登录交换机switch(config)#authentication security ip 192.168.1.2(2)限制允许IP地址段Telnet登录交换机switch(config)#access-list 1 permit 192.168.1.0 0.0.0.255switch(config)#authentication ip access-class 1 in5、为交换机设置Web授权用户和口令:web-user <用户名>password {0|7} <密码>例:Switch(Config)#web-user admin password 0 digital6、设置系统日期和时钟:clock set7、设置退出特权用户配置模式超时时间exec timeout //单位为分钟,取值范围为0~3008、保存配置:write9、显示系统当前的时钟:Switch#show clock10、指定登录用户的身份是管理级还是访问级Enable [level {visitor|admin} [<密码>]]11、指定登录配置模式的密码:Enable password level {visitor|admin}12、配置交换机的用户名密码:username admin privilege 15 password 0 admin00013、配置enable密码为ddd:enable password 0 ddd level 1514、配置登录时认证:authentication line vty login local15、设置端口的速率和双工模式(接口配置模式下)命令:speed-duplex {auto | force10-half | force10-full | force100-half | force100-full |{{force1g-half | force1g-full} [nonegotiate [master | slave]] } }no speed-duplex二、单交换机VLAN划分1、VLAN基本配置(1)新建VLAN:vlan(2)命名VLAN:name(3)为VLAN 分配交换机端口Switch(Config-If-Vlan1)#switchport interface Ethernet 0/2(4)设置Trunk 端口允许通过VLAN:Switch(Config-ethernet0/0/5)#switchport trunk allowed vlan 1;3;5-202、划分VLAN:(1)进入相应端口:Switch(config)#interface Ethernet 0/2(2)修改模式:Switch(Config-ethernet0/0/5)switchport mode access (3)划分VLAN:Switch(Config-ethernet0/0/5)#switchport access vlan 4三、跨交换机VLAN划分(两台交换机作相同操作)1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk四、VLAN间主机的通信1、新建VLAN2、划分VLAN3、修改链路模式(1)进入相应端口:Switch(config)#interface Ethernet 0/1(2)修改模式:Switch(config-if)#switchport mode trunk注意:如果是三层交换机,在修改模式先封装802.1协议:Switch(config-if)#switchport trunk encapsulation dot1q4、建立VLAN子接口(1)、进入VLAN接口模式:Switch(config)#interface vlan 2(2)、设置VLAN子接口地址:Switch(config-if)#ip address 192.168.0.1 255.255.255.0 (3)、打开端口:Switch(config-if)#no shutdown5、设置各主机IP地址、子网掩码、网关注意:(1)各主机IP地址应与其所在的VLAN在同一网段。
神州数码交换机配置基本命令
交换机基本状态:
hostname> ;用户模式
hostname# ;特权模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口状态
交换机口令设置:
switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令
switch(config)#enable password xxa ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4 ;进入虚拟终端
switch(config-line)#login ;允许登录
switch(config-line)#password xx ;设置登录口令xx
switch#exit ;返回命令
交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式
交换机设置IP地址:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address ;设置IP地址
switch(config)#ip default-gateway ;设置默认网关
switch#dir Flash: ;查看闪存
交换机显示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息
完了最最要的一步。
要记得保存设置俄,
保存命令:switch(config)#copy running-config startup-config。