神州数码交换机路由器命令汇总(最简输入版)

合集下载

神州数码配置命令总结

神州数码配置命令总结

神州数码配置命令总结第一部分交换机配置一、基础配置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、为交换机设置T elnet授权用户和口令:telnet-user <用户名>password {0|7} <密码>例:Switch(Config)#telnet-user test password 0 test5、为交换机设置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、设置端口的速率和双工模式(接口配置模式下)命令: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在同一网段。

神州数码交换机路由器命令

神州数码交换机路由器命令

神州数码交换机路由器命令神州数码交换机路由器命令交换机配置命令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 查看路由。

神州数码路由器配置相关命令

神州数码路由器配置相关命令

一、路由器工作模式:用户模式:Router>特权模式:Router #全局配置模式:Router (config)#接口配置模式:Router (config-if)#路由配置模式:Router(config-router)#Line配置模式:Router(config-line)#二、路由器口令设置:Router>enable;进入特权模式Router#configterminal;进入全局配置模式Router(config)#hostname xxx;设置路由器的主机名Router(config)#enable secret level 15 0 xxx ;设置特权明文加密口令xxx Router (config)#enable password xxx;设置特权非密口令Router(config)#line console 0;进入控制台口Router(config-line)#line vty 0 4;进入虚拟终端Router(config-line)#login;允许登录Router(config-line)#password xx ;设置登录口令xxRouter#exit;返回命令三、路由器VLAN设置:配置WAN接口选择接口:Router(config)#i nterface s0/0/0配置IP地址Router(config-if)#ip address 192.168.10.1 255.255.255.0设置时钟频率:Router(config-if)#clock rate 64000(另一端无需配置)启用端口:Router(config-if)#no shutdown四、路由协议设置:静态路由:Router(config)#ip route network 目标网络网络掩码下一跳IP Router(config)#ip route 192.168.1.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指定版本协议:Router(config-router)#version 2声明直连网络号:Router(config-router)#network 直连网段Router(config-router)#network 192.168.1.0开启进程号为1的ospf协议:Router(config)#router ospf1声明直连网络号Router(config-router)#network直连网段反掩码area区域号Router(config-router)#network 192.168.1.0 0.0.0.255 area 0查看路由表:Router#showip route配置路由访问控制命令格式:Router(config)#access-list 列表号permit源IP地址反掩码配置允许:Router(config)#access-list 1 permit 192.168.10.1 0.0.0.255配置拒绝访问:Router(config)# access-list 1 deny 192.168.20.0 0.0.0.255配置允许其他:Router(config)#access-list 1 permit any端口绑定命令:进入相应端口:Router(config)#interface fa0/1配置列表防止位置:Router(config-if)#ip access-group 1 outRouter(config-if)#配置路由DHCP服务开启dhcp服务:Router(config)#service dhcp设置地址池:Router(config)#ipdhcp pool 172.16.12.0设置网段:Router(dhcp-config)#network 172.16.12.0 255.255.255.0设置默认网关:Router(dhcp-config)#default-router 172.16.12.200Router(dhcp-config)#exit设置排除地址:Router(config)#ipdhcp excluded-address 172.16.12.151 172.16.12.254 进入网关端口:Router(config)#interface g0/0设置网关IP:Router(config-if)#i p address 172.16.12.200 255.255.255.0配置路由NAT静态NATRouter1(config)#ipnat inside source static 192.168.11.2 200.200.200.3Router1(config)#interface fa0/0Router1(config-if)#ipnat insideRouter1(config)#interface Serial0/0/0Router1(config-if)#ipnat outside动态NATRouter1(config)#ipnat pool NAT 200.200.200.3 200.200.200.4 network 255.255.255.0//定义内部全局IP地址池NAT Router1(config)#access-list 1 permit 192.168.11.00.0.0.255 //定义可转换内部本地IP地址Router1(config)#ipnat inside source list 1 pool NAT //配置动态NAT映射Router1(config)#interface fa0/0 //定义内部接口Router1(config-if)#ipnat insideRouter1(config)#interface Serial0/0/0 //定义外部接口Router1(config-if)#ipnatoutsideRouter1(config-if)#no shutdown路由器显示命令:Router#dir Flash: ;查看闪存Router#write;保存配置信息Router#show run;查看当前配置信息Router#show ip access-list //查看ACL配置信息Router#clean ipnat translation //清除动态NA T转换列表信息Route#show ipnat statistics //查看NA T转换统计信息Route#clean ipnat statistics //清除NA T转换统计信息完了最最要的一步。

神州数码路由和交换器命令

神州数码路由和交换器命令

1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout# login# ifconfig ;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址# ifconfig eht0 <ip address> netmask <netmask> down ;删除IP地址# route add 0.0.0.0 gw <ip># route del 0.0.0.0 gw <ip># route add default gw <ip> ;设置网关# route del default gw <ip> ;删除网关# route ;显示网关# ping <ip># telnet <ip>2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon> ;路由器的ROM状态hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;界面状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <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 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 <name> ;设置发vtp域名switch(config)#vtp password <word> ;设置发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> <mask> ;设置IP地址switch(config)#ip default-gateway <IP> ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail界面router(config-if)#no shutdown ;启动当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address <ip> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IP router(config-if)#int f0/0.1 ;进入子界面router(config-subif.1)#ip address <ip> <netmask> ;设置子界面IP router(config-subif.1)#encapsulation dot1q <n> ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器檔操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftp router#copy startup-config tftp ;开机配置存到tftp router#copy tftp flash: ;下传文件到flash router#copy tftp startup-config ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器屏蔽rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的檔rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协定。

神州数码交换机路由器配置命令(2023最新版)

神州数码交换机路由器配置命令(2023最新版)

神州数码交换机路由器配置命令神州数码交换机路由器配置命令章节一:引言⑴文档目的本文档旨在提供神州数码交换机路由器的详细配置命令,以指导管理员进行设备的初始化和配置。

⑵背景神州数码交换机路由器是一种用于数据传输的网络设备,拥有多种功能和特性。

本文档将介绍如何使用各种命令来配置交换机路由器的不同功能。

⑶受众本文档适用于所有需要配置神州数码交换机路由器的管理员和网络工程师。

章节二:初始化设备⑴登录设备使用如下命令登录设备:`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.法律名词及注释在本文档中所涉及的法律名词和相关注释的完整列表。

神州数码交换机路由器常用命令操作

神州数码交换机路由器常用命令操作

神州数码交换机路由器常用命令操作神州数码交换机常用命令操作交换机初始化 Ctrl+B交换机恢复默认值 Setdefault write Reload1. 创建vlan、将端口指定为相应vlan、vlan分配IPVlan [编号] //创建vlan 例:vlan10Swi Int eth0/0/[编号-编号] //指定那些端口属于这个vlan 例:swi Inte0/0/1-10 int vlan [编号] //进入vlan接口例:int vlan 10Ip add [IP地址] [子网掩码] //配置IP地址例:ip add 192.168.1.1255.255.255.0创建私有vlan方法 Vlan 10Private-vlan primary 指定为主vlan Vlan 11Private-vlan community 指定为群体vlan Vlan 12priate-vlan isolated 指定为隔离vlan 创建关联:vlan 10Priate-vlan association [关联的vlan号] //主vlan关联群体vlan和隔离vlan 给各vlan指定相应端口结果:群体vlan和隔离vlan ping主vlan 通群体vlan内通;主vlan 内通;群体vlan间不通;隔离vlan内不通;2.配置远程管理(可通过setup配置)(1)交换机telnet远程管理telnet-server enable // 开启telnet服务,默认以开启telnet-user [用户] password 0 [密码] //添加telnet管理用户(2)web服务管理Ip http sever // 开启web服务,需手动开启 Web-user [用户名] password 0 [密码] //添加web管理用户3.静态路由Ip route [目标地址段] [目标掩码] [下一跳IP/接口]Ip route 0.0.0.0 0.0.0.0 [下一跳IP/接口] //ip route 0.0.0.0 0.0.0.0 192.168.1.2 4.RIP协议路由以Vlan方法Router ripName[名称]Networkvlan[编号] //networkvlan10以IP方法 Router rip Name [名称] Network [ip段] 5.ospf协议路由以Vlan方法Router ospf [ 编号] //默认编号是1Int vlan [vlan号] //int vlan 10 [区域号]默认为0,必须有Ip ospf enable area [区域号] //ip ospf enable area 0以IP方法Router ospf [ 编号] Router-id [ip地址]Network [自己的IP] [网关] area 0 //network 192.168.1.1/24 area 06.生成树协议 1)Stp模式配置spanning-tree //启用生成树spanning-tree mode stp //设置生成树模式spanning-tree mst 0 priority 4096 //设置生成树交换机优先级2)mstp的配置 spanning-treespanning-tree mst configuration name [名称]instance [实例号] vlan [编号]spanning-tree mst [实例号] priority 4096 //设置生成树交换机优先级spanning-tree mst [实例号] port-priority 16 //设置生成树端口优先级 3)配置成快速启用端口 Int e0/0/[编号-编号]Spanning-tree portfast 7.链路聚合(手工)port-group [组号] // 创建聚合组号 inte0/0/[做链路的那几个端口号] //将端口加入聚合组port-group [组号] mode on 8.链路聚合(LACP动态生成)port-group [组号]int e0/0/[做链路的那几个端口号](交换机A的配置)port-group [组号] mode active (交换机B的配置)port-group [组号] mode passive 9.trunkInt e0/0/[端口]Sw mode trunk //设置为trunk Sw trunk allowed vlan all //划分到所有vlan 10.Mac地址和端口绑定(单个) Int e0/0/[端口] Sw port-securitySw port-security mac-address [mac地址] 11.Mac地址和端口绑定(多个)Inte0/0/[端口]Sw port-securitySw port-security maximum [安全mac地址个数如:3] sw port-security mac-address [mac地址] sw port-security mac-address [mac地址] sw port-securitymac-address [mac地址] 12.Mac地址和端口绑定(动态学习) Int e0/0/[端口]Sw port-security maximumSw port-security maximum lock Sw port-security maximum convert 13.mac地址表绑定mac-address-table static address[mac地址]vlan[编号]inte0/0/[编号]//解释:让mac地址只能在指定vlan中的指定端口中使用,其他的都不能使用(未测试) 14. 端口安全1) int e0/0/1-10 //进入端口,只能在access口上配置 2) switchport port-security // 开启端口安全功能3) switchport port-security maximum 5 //配置端口安全最大连接数 4) sw port-security violation shutdown //配置违例处理方式5).sw port-security mac-address [mac地址] //配置mac地址绑定15. 交换机端口镜像(将源端口数据复制到目标端口)1) monitor session 1 source interface fastEthernet 0/2 both //源端口、被镜像的端口 2) monitor session 1 destiNation interface fastEthernet 0/3 //目标端口、镜像端口 16.dhcp配置1)交换机做dhcp服务器配置Service dhcp //启用DHCP服务 Ip dhcp pool [地址池名]Network-address [IP段如:192.168.1.0] [掩码数如:24] Lease[租用天数]Default-router[网关IP] Dns-server[DNS的IP]Ip dhcp excluded-address//指定网段中不分配的IP地址 2)Dhcp中继服务的配置Service dhcpIp forward-protocol udp bootps //配置DHCP中继转发port端口的UDP广播报文,默认67端口 Int vlan [编号]或在接口上配置 //int e0/0/[编号]Ip help-address [服务器IP] //指定DHCP中继转发的UDP报文的目标地址17.ACL IP访问控制下面2条是开启ACLFirewall enable //开启包过滤功能Firewall default permit //设置默认动作为允许 //定义标准访问控制列表 //定义访问列表Ip access-list standard test //在端口上应用列表Deny 192.168.1.100.00.0.0.0.255//禁止IP段访问 Deny 192.168.200.11 0.0.0.0//禁止单个IP访问Denytcp192.168.200.00.0.0.255any-destinationd-port23//拒绝IP段telnet数据Permit192.168.1.100.00.0.0.0.255//允许IP段访问 Deny192.168.200.110.0.0.0//允许IP访问 //绑定ACL到各个端口 Inte0/0/[端口]Ip access-group test in //验证方法Show access-group 标准ACL实验1) access-list 1 deny 192.168.1.0 0.0.0.255 //拒绝访问的IP段 2) access-list 1 permit 192.168.1.0 0.0.0.255 //允许的IP段 3) //进入端口4) ip access-group 1 in //把控制列表1 配入端口,进入控制 5) ip access-group 1 out //把控制列表1 配入端口,输出控制15. 扩展ACL实验1) access-list 101 deny tcp A.B.C.D 255.255.255.0 A.B.C.D 255.255.255.0 eq ftp(WWW)// 禁止前面个网段访问后面个网段的ftp或者WWW16. 交换机单向访问控制 1) //使用标准ACL2) access-list 1 deny 192.168.1.0 0.0.0.255 3) //进入端口4) ip access-group 1 in神州数码路由器常用命令操作路由器初始化:ctrl+break Nopassword 路由器恢复默认值 dirDel startup-config Reboot1.进入端口给端口分配IP Int [端口]Ip add [ip] [子网掩码] No shuFC串口配置时钟频率Ph sp 64000 2.静态路由Ip route [目标地址段] [目标掩码] [下一跳IP/接口]Ip route 0.0.0.0 0.0.0.0 [下一跳IP/接口] //默认路由 Ip route 0.0.0.0 0.0.0.0 [下一跳IP/接口] 10 //浮动路由3.RIP协议路由 Router ripNetwork [ip段] 4.ospf协议路由Router ospf [进程号] Router-id [ip地址]Network [自己的IP段] [子网掩码] area [区域号如:0] 5.telnet开启方法1Aaa authen enable default line Aaa authen login default line Enable passwd [密码] Line vty 0 4Password [密码] 方法2Username [用户名] password [密码]Aaa authentication login [用户名] local Line vty 0 4Login authentication [刚刚那个用户名] 6.web访问配置Username [用户] password 0 [密码] //添加用户Ip http webm-type[web配置方式] //选择方式.高级,典型,向导Ip http port[端口] //配置web端口7.ppp协议时钟频率physical-layer speed 64000 封装PPP协议 Int s0/[编号]Enc ppp //封装PPP协议单向验证(验证方式为PAP和CHAP)验证方Aaa authen ppp default localUsername [用户名] password [密码] Int s0/[编号] Enc pppPpp authen pap 被验证方Aaa authen ppp default local Int s0/[编号] Enc pppPpp pap sen [用户名] passwd [密码] 双向验证: 9.hdlcInt s0/[编号]Enc hdlc //和PPP差不多,都在端口中配置10.dhcp配置Ip dhcp pool[地址池名]Network 192.168.2.0 255.255.255.0 //定义网络段 Range192.168.2.10 192.168.2.20 //定义地址范围 Default-router [IP] //配置网关 Dns-sever [ip] //配置NDS的IP Lease [天数] //租用天数 //退回配置模式(config) Ip dhcpdenable//开启dhcp11.Nat网络地址转换分为三种静态地址转换、动态地址转换、端口复用第一种1对1的网络地址转换,也叫静态地址转换,主要用于发布服务器(FTP/WEB/telnet) 1)定义内外口在端口下输入ip nat inside ip nat outside2)配置地址转换:ip nat inside source staticip nat inside source static tcp 80 80 发布WWW服务 ip nat inside source static tcp 20 20 发布ftp服务 ip nat inside source static tcp 21 21ip nat inside source static tcp 23 23 允许telnet远程登陆第二种多对多的网络地址转换,也叫动态地址转换1)定义内外口在端口下输入ip nat inside ip nat outside 2)定义内网访问列表(标准)和外网的地址池定义内网访问列表:ip access-list standardpermit //定义允许转换的源地址范围定义外网的地址池:ip nat pool netmask 3)配置地址转换:ip nat inside source list pool overload感谢您的阅读,祝您生活愉快。

神州数码路由器及交换机配置命令

神州数码路由器及交换机配置命令

神州数码交换机配置命令交换机基本状态: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. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

神州数码交换机路由器命令汇总(部分)2016年3月23日星期三修改_________________________________________________________________________注:本文档命令为最简命令,如不懂请在机器上实验注:交换机版本信息:DCRS-5650-28(R4) Device, Compiled on Aug 12 10:58:26 2013sysLocation ChinaCPU Mac 00:03:0f:24:a2:a7Vlan MAC 00:03:0f:24:a2:a6SoftWare Version 7.0.3.1(B0043.0003)BootRom Version 7.1.103HardWare Version 2.0.1CPLD Version N/ASerial No.:1Copyright (C) 2001-2013 by Digital China Networks Limited.All rights reservedLast reboot is warm reset.Uptime is 0 weeks, 0 days, 1 hours, 42 minutes路由器版本信息:Digital China Networks Limited Internetwork Operating System SoftwareDCR-2659 Series Software, Version 1.3.3H (MIDDLE), RELEASE SOFTWARECopyright 2012 by Digital China Networks(BeiJing) LimitedCompiled: 2012-06-07 11:58:07 by system, Image text-base: 0x6004ROM: System Bootstrap, Version 0.4.2Serial num:8IRTJ610CA15000001, ID num:201404System image file is "DCR-2659_1.3.3H.bin"Digital China-DCR-2659 (PowerPC) Processor65536K bytes of memory,16384K bytes of flashRouter uptime is 0:00:44:44, The current time: 2002-01-01 00:44:44Slot 0: SCC SlotPort 0: 10/100Mbps full-duplex EthernetPort 1: 2M full-duplex SerialPort 2: 2M full-duplex SerialPort 3: 1000Mbps full-duplex EthernetPort 4: 1000Mbps full-duplex EthernetPort 5: 1000Mbps full-duplex EthernetPort 6: 1000Mbps full-duplex Ethernet一、交换机配置命令1.基本配置switch > en (enable )进入特权用户模式 switch # con (config) 进入全局配置模式switch (config)# ho switch (hostname) 配置交换机名称 switch (config)# in e1/0/1 进入接口配置模式 switch (config -if -ethernet1/0/1)# exswitch (config)# in vl 1 进入VLAN 配置模式switch (config -if -vlan1)# ip ad 192.168.1.252 255.255.255.0 switch (config -if -vlan1)# exswitch (config)# ena p 1234 配置交换机密码(不加密) switch (config)# ena p 7 1234 配置交换机密码(加密) switch (config)# vl 10 创建vlan switch (config -vlan10)#ex switch (config)# in vl 10switch (config -if -vlan10)# ip ad 172.16.10.1 255.255.255.0 配置VLAN 地址2.生成树技术switch (config)# sp (spanning -tree) 启用全局生成树(默认mstp 生成树技术) switch (config)# sp mo stp/rstp /mstp (生成树/快速生成树/多生成树技术) switch (config)# sp ms 0 p 4096 设置交换机的优先级 默认32768 switch (config)# sh sp (show spanning -tree) 查看生成树3.交换机Web 管理switch (config)# ip ht serswitch (config)# usern admin pa 1234 用户名和密码4.交换机Telnet 管理switch (config)# telnet -s e (telnet enable) 开启telnet 服务 switch (config)# usern admin pa 1234 用户名和密码5.链路聚合(不需启动生成树)switchA (config)# port -g 1 (prot -group) switchA (config)# in e1/0/1-2switchA (config -port -range)# po 1 m on/active switchA (config -port -range)# ex switchA (config)# no port -g 1 删除组1switchB (config)# port -g 2 switchB (config)# in e1/0/3-4switchB (config -port -range)# po 2 m on/active switchB (config -port -range)# ex switchB (config)# no port -g 2 删除组26.交换机MAC 与IP 绑定switch (config)# am e (am enable) 启用全局am 功能 switch (config)# in e1/0/1switch (config_if_ethernet1/0/1)# am p (am port) 打开端口am 功能switch (config_if_ethernet1/0/1)# am m (mac -ip -pool) 00-A0-D1-D1-07-FF 192.168.1.101 switch (config_if_ethernet1/0/1)# ex switch (config)# in e1/0/2输入这条命令会出现: Invalid ENCRYPTED password! Please input the ENCRYPTED password with length 32 密码位数不够32位switch (config_if_ethernet1/0/2)# no am p 解锁端口7.交换机MAC与IP绑定静态绑定switch (config)# in e1/0/1switch (config_if_ethernet1/0/1)# sw p (port-security) 开启绑定功能switch (config_if_ethernet1/0/1)# sw p mac 00-a0-d1- d1-07-ff 添加静态MAC地址switch (config_if_ethernet1/0/1)# sw p max 4 绑定MAC地址的个数(默认为1)动态绑定(实验中交换机没有动态绑定命令)switch (config)# in e1/0/1switch (config_if_ethernet1/0/1)# sw p (port-security) 开启绑定功能switch (config_if_ethernet1/0/1)# sw port-security lockswitch (config_if_ethernet1/0/1)# sw port-security convert 将动态学习到绑定MAC的进行绑定switch # sh port-s add 查看绑定的地址8.交换机DHCP服务器配置switch (config)# service dhcp 启用DHCPswitch (config)# ip dh po poolA定义地址池poolAswitch (dhcp-poolA- config)# netw (network-address) 192.168.1.0 24switch (dhcp-poolA- config)# de (default-router) 192.168.1.254网关switch (dhcp-poolA- config)# dn 60.191.244.5DNS服务器switch (dhcp-poolA- config)# le 3租期3天switch (dhcp-poolA- config)# exswitch (config)# ip dh ex (excluded-add) 192.168.1.252 192.168.1.254 排除地址范围9.保留地址(一个地址池中只能配一个IP-MAC的绑定)switch (config)# ip dh po poolCswitch (dhcp-poolC- config)# ho 192.168.1.100 绑定的IP地址switch (dhcp-poolC- config)# ha (hardware-add) 00-a0-d1- d1-07-ff 绑定的MAC地址switch (dhcp-poolC- config)# de 192.168.1.254 网关10.ACL访问控制列表switchA (config)# ip ac s (standard) test命名标准IP访问列表switchA (config-std-nacl-test)# d (deny) 192.168.100.0 0.0.0.255反子网掩码(路由器上为子网掩码)switchA (config-std-nacl-test)# d 192.168.200.0 0.0.0.255switchA (config-std-nacl-test)# p (permit) a (permit any) 允许所有switchA (config-std-nacl-test)# exswitchA (config)# fir e (firewall enable) 开启ACL功能switchA (config)# in e1/0/1switchA (config-if-interface1/0/1)# ip ac (access-group) test in/out 进in出out (二层交换机上不支持out)11.配置时间范围switchA (config)# time-r worktimeswitchA (config-time-range)# p (periodic) weekd 9:0:0 to 18:0:012.VRRP虚拟路由器冗余协议Master BackupswitchA (config)# router v 1 switchB (config_router)# router v 1switchA (config_router)# v (virtual-ip) 192.168.1.254 switchB (config_router)# v 192.168.1.254 switchA (config_router)# i v 1 (interface vlan 1) switchB (config_router)# i v 1switchA (config_router)# pri 110 switchB (config_router)# enaswitchA (config_router)# c (circuit-failover) v 10 20switchA (config_router)# ena13.DHCP中继DHCP_relay (config)# service dhcp 全局开启DHCP服务DHCP_relay (config)# ip fo u b (ip forward-protocol udp bootps) 全局开启转发DHCP_relay (config)# in vl 10DHCP_relay (config-if-vlan10)# ip h 172.16.1.1 转发到DHCP服务器地址14.DHCP侦听DHCP (config)# service dhcpDHCP (config)# ip dh sn e 开启DHCP侦听功能DHCP (config)# in e1/0/1DHCP (config-if-ethernet1/0/1)# ip d s t (ip dhcp snooping trust)设置上联口为信任口15.端口隔离Switch (config)# is g test s i e1/0/1-2 (isolate-port group test switchport interface e1/0/1-2)e1/0/1-2口不能互相通信,可以和其它端口通信。

相关文档
最新文档