1.交换机支持的命令:交换机基本状态:switch:;ROM状态,路由器是rommon》hostname》;用户模式hostname;特权模式hostname(config);全局配置模式hostname(config-if);接口状态交换机口令设置:switch》enable;进入特权模式switchconfigterminal;进入全局配置模式switch(config)hostname;设置交换机的主机名switch(config)enablesecretxxx;设置特权加密口令switch(config)enablepasswordxxa;设置特权非密口令switch(config)lineconsole0;进入控制台口switch(config-line)linevty04;进入虚拟终端switch(config-line)login;允许登录switch(config-line)passwordxx;设置登录口令xxswitchexit;返回命令交换机VLAN设置:switchvlandatabase;进入VLAN设置switch(vlan)vlan2;建VLAN2switch(vlan)novlan2;删vlan2switch(config)intf0/1;进入端口1switch(config-if)switchportaccessvlan2;当前端口加入vlan2switch(config-if)switchportmodetrunk;设置为干线switch(config-if)switchporttrunkallowedvlan1,2;设置允许的vlanswitch(config-if)switchporttrunkencapdot1q;设置vlan中继switch(config)vtpdomain;设置发vtp域名switch(config)vtppassword;设置发vtp密码switch(config)vtpmodeserver;设置发vtp模式switch(config)vtpmodeclient;设置发vtp模式交换机设置IP地址:switch(config)interfacevlan1;进入vlan1switch(config-if)ipaddress;设置IP地址switch(config)ipdefault-gateway;设置默认网关switchdirflash:;查看闪存交换机显示命令:switchwrite;保存配置信息switchshowvtp;查看vtp配置信息switchshowrun;查看当前配置信息switchshowvlan;查看vlan配置信息switchshowinterface;查看端口信息switchshowintf0/0;查看指定端口信息2.路由器支持的命令:路由器显示命令:routershowrun;显示配置信息routershowinterface;显示接口信息routershowiproute;显示路由信息routershowcdpnei;显示邻居信息routerreload;重新起动路由器口令设置:router》enable;进入特权模式routerconfigterminal;进入全局配置模式router(config)hostname;设置交换机的主机名router(config)enablesecretxxx;设置特权加密口令router(config)enablepasswordxxb;设置特权非密口令router(config)lineconsole0;进入控制台口router(config-line)linevty04;进入虚拟终端router(config-line)login;要求口令验证router(config-line)passwordxx;设置登录口令xxrouter(config)(Ctrl+z);返回特权模式routerexit;返回命令路由器配置:router(config)ints0/0;进入Serail接口router(config-if)noshutdown;激活当前接口router(config-if)clockrate64000;设置同步时钟router(config-if)ipaddress;设置IP地址router(config-if)ipaddresssecond;设置第二个IProuter(config-if)intf0/0.1;进入子接口router(config-subif.1)ipaddress;设置子接口IProuter(config-subif.1)encapsulationdot1q;绑定vlan中继协议router(config)config-register0x2142;跳过配置文件router(config)config-register0x2102;正常使用配置文件routerreload;重新引导路由器文件操作:routercopyrunning-configstartup-config;保存配置routercopyrunning-configtftp;保存配置到tftproutercopystartup-configtftp;开机配置存到tftproutercopytftpflash:;下传文件到flashroutercopytftpstartup-config;下载配置文件ROM状态:Ctrl+Break;进入ROM监控状态rommon》confreg0x2142;跳过配置文件rommon》confreg0x2102;恢复配置文件rommon》reset;重新引导rommon》copyxmodem:flash:;从console传输文件rommon》IP_ADDRESS=10.65.1.2;设置路由器IPrommon》IP_SUBNET_MASK=255.255.0.0;设置路由器掩码rommon》TFTP_SERVER=10.65.1.1;指定TFTP服务器IPrommon》TFTP_FILE=c2600.bin;指定下载的文件rommon》tftpdnld;从tftp下载rommon》dirflash:;查看闪存内容rommon》boot;引导IOS静态路由:iproute;命令格式router(config)iproute2.0.0.0255.0.0.01.1.1.2;静态路由举例router(config)iproute0.0.0.00.0.0.01.1.1.2;默认路由举例动态路由:router(config)iprouting;启动路由转发router(config)routerrip;启动RIP路由协议。router(config-router)network;设置发布路由router(config-router)negihbor;点对点帧中继用。最好是去官方网站参考手册。
Cisco路由器配置命令大全
为方便考生复习思科路由器的配置,以下是我为大家整理的Cisco路由器配置命令,欢迎阅读与收藏。
1. switch配置命令
(1)模式转换命令
用户模式----特权模式, 使用命令"enable"
特权模式----全局配置模式, 使用命令"config t"
全局配置模式----接口模式, 使用命令"interface+接口类型+接口号"
全局配置模式----线控模式, 使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.
特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置
线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址 配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性
show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory 修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service password-encryptin 手工加密所有密码
enable password +密码 配置明文密码
ena sec +密码 配置密文密码
line vty 0 4/15 进入telnet接口
password +密码 配置telnet密码
line aux 0 进入AUX接口
password +密码 配置密码
line con 0 进入CON接口
password +密码 配置密码
bandwidth+数字 配置带宽
no ip address 删除已配置的IP地址
show startup config 查看NVRAM中的配置信息
copy run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner motd +信息 + 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database 进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport access vlan +vlan号 为VLAN为配接口
interface vlan +vlan号 进入VLAN接口模式
ip add +ip地址 为VLAN配置管理IP地址
vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名
vtp +password +密码 配置SW的密码
switchport mode trunk 启用中继
no vlan +vlan号 删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议
2. 路由器配置命令
ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols 显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议, 同时给出了在路由选择协议中使用的定时器等信息
router rip 激活RIP协议
路由器的几个基本命令:
Router》enable 进入特权模式
Routerdisable 从特权模式返回到用户模式
Routerconfigure terminal 进入到全局配置模式
Router(config)interface ethernet 1 进入到路由器编号为1的以太网口
exit 返回上层模式
end 直接返回到特权模式
========================================================
注意:
1、CISCO CATALYST(交换机),如果在初始化时没有发现“用户配置”文件,就会自动载入Default Settings(默认配置)文件,进行交换机初始化,以确保交换机正常工作。
2、CISCO Router(路由器)在初始化时,如果没有发现“用户配置”文件,系统会自动进入到“初始化配置模式”(系统配置对话模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!
========================================================
1、CONSOLE PORT(管理控制台接口):距离上限制,独占的方式。刚开始配置的时候一般使用这个。
2、AUX port(辅助管理接口):可以挂接MODEM实现远程管理,独占的方式。
3、Telnet:多人远程管理(决定于性能,VTY线路数量)不安全。后期维护,远程管理登陆。
========================================================
注意:
交换机、路由器配置命令都是回车后立即执行,立即生效的。在运行中的机器上修改命令的时候要特别注意。
========================================================
Router(config)hostname ?
WORD This system’s network name
在配置模式下修改当前主机的本地标识,例:
------------------
Router(config)hostname r11
r11(config)
------------------
r11(config-if)ip address ?
A.B.C.D IP address
为当前端口设置IP地址,使用前先进入需要配置的端口,例:
------------------
r11(config)interface ethernet 1
r11(config-if)ip address 172.16.1.1 255.255.255.0
------------------
r11》show version
r11show version 观察IOS版本,设备工作时间,相关接口列表
r11show running-config 查看当前生效的配置,此配置文件存储在RAM
r11show interfaces ethernet 1 查看以太网接口的状态,工作状态等等等...
========================================================
r11reload 重新加载Router(重启)
r11setup 手工进入setup配置模式
r11show history 查看历史命令(最近刚用过的命令)
r11terminal history size《0-256》设置命令缓冲区大小,0 : 代表不缓存
r11copy running-config startup-config 保存当前配置
注意概念:
nvram:非易失性内存,断电信息不会丢失 《-- 用户配置 《-- 保存着startup-config
ram:随机存储器,断电信息全部丢失 《-- 当前生效配置 《-- 保存着running-config
startup-config:在每次路由器或是交换机启动时候,会主动加载(默认情况)
========================================================
设置说明和密码的几个命令:
r11(config)banner motd 另起一行结束,描述机器登陆时的说明
r11(config-if)description 描述接口注释,需要在端口配置模式下
配置console口密码:
------------------
r11(config)line console 0 进入到consolo 0
r11(config-line)password eliuzd 设置一个密码为“eliuzd”
r11(config-line)login 设置login(登陆)时使用密码
------------------
配置enable密码:
------------------
r11(config)enable password cisco 设置明文的enable密码
r11(config)enable secret eliuzd 设置暗文的enable密码(优先于明文被使用)
r11(config)service password-encryption 加密系统所有明文密码(功能较弱)
------------------
配置Telnet密码:
------------------
r11(config)line vty 0
r11(config-line)password cisco
r11(config-line)login
------------------
========================================================
配置虚拟回环接口:(回环接口默认为UP状态)
(config) 下,虚拟一个端口
------------------
r11(config)interface loopback 0 创建一个回环接口loopback 0
r11(config-if)ip address 192.168.1.1 255.255.255.0 配置它的IP地址
no * 做配置的反向操作(删除配置)
------------------
=========================================================
路由器 DCE/DTE 仅存在广域网中
r11show controllers serial 0 用于查看DCE与DTE的属性,serial 0路由器广域网端口
DCE的Router需要配置时钟频率
r11(config-if)clock rate ? 配置DCE接口的时钟频率(系统指定频率)
一般实际情况下,这个不需要自己配置,因为DCE设备都在运营商那。
=========================================================
r11show interfaces serial 1
查看端口状态,第一行提示说明
Serial1 is administratively down, Line protocol is down
没有使用no shutdown命令激活端口
Serial1 is down, Line protocol is down
1、对方没有no shutdown激活端口
2、线路损坏,接口没有任何连接线缆
Serial1 is up, line protocol is down
1、对方没有配置相同的二层协议,Serial接口default encapsulation: HDLC
2、可能没有配置时钟频率
3、可能没有正确的配置三层地址(可能)
Serial1 is up,line protocol is up
接口工作正常
========================================================
查看CDP信息的几个命令:
r11show cdp neighbors 查看CDP的邻居(不含IP)
r11show cdp neighbors detail 查看CDP的邻居(包含三层的IP地址)
r11show cdp entry * 查看CDP的邻居(包含三层的IP地址)老命令
r1(config)no cdp run 在全局配置模式关闭CDP协议(影响所有的接口)
r1(config-if)no cdp enable 在接口下关闭CDP协议(仅仅影响指定的接口)
r11clear cdp table 清除CDP邻居表
r11show cdp interface serial 1 查看接口的CDP信息
注意两个提示:
Sending CDP packets every 60 seconds(每60秒发送cdp数据包)
HoldTime 180 seconds(每个cdp数据包保持180秒)
========================================================
r11(config)ip host 设置静态的主机名映射
r11show sessions 查看设置过的映射主机名
========================================================
Telnet *.*.*.* 被telnet的设备,需要设置line vty的密码,如果需要进入特权模式需要配置enable密码
H3C路由器配置命令 H3C CAS云计算管理平台基于业界领先的虚拟化基础架构,实现了数据中心IaaS云计算环境的中央管理控制,以简洁的`管理界面,统一管理数据中心内所有的物理资源和虚拟资源。下面是我整理的关于H3C路由器配置命令,希望大家认真阅读! 一、路由器基本配置命令 1、system-view 进入系统视图模式 2、sysname R1 为设备命名为R 3、display ip routing-table 显示当前路由表 4、language-mode Chinese|English 中英文切换 5、interface Ethernet 0/0 进入以太网端口视图 6、ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码 7、undo shutdown 打开以太网端口 8、shutdown 关闭以太网端口 9、quit 退出当前视图模式 10、ip route-static 192.168.2.0 255.255.255.0 192.168.12.2 description To.R2 配置静态路由 11、ip route-static 0.0.0.0 0.0.0.0 192.168.12.2 description To.R2 配置默认的路由 基本配置案例 display version 显示版本信息 display current-configuration 显示当前配置 display interfaces 显示接口信息 display ip route 显示路由信息 sysname aabbcc 更改主机名 super passwrod 123456 设置口令 interface serial0 进入接口 ip address undo shutdown 激活端口 link-protocol hdlc 绑定hdlc协议 user-interface vty 0 4 authentication-mode password set authentication-mode password simple 2 user privilege level 3 quit debugging hdlc all serial0 显示所有信息 debugging hdlc event serial0 调试事件信息 debugging hdlc packet serial0 显示包的信息 静态路由配置案例: ip route-static {interface number|nexthop} 例如: ip route-static 129.1.0.0 16 10.0.0. ip route-static 129.1.0.0 255.255.0.0 10.0.0. ip route-static 129.1.0.0 16 Serial ip route-static 0.0.0.0 0.0.0.0 10.0.0. 动态路由配置案例(RIP): rip rip work rip input rip output network 1.0.0.0 ;可以all network 2.0.0.0 peer ip-address summary rip version rip version 2 multicast rip split-horizon ;水平分隔 动态路由配置案例(OSPF): router id A.B.C.D 配置路由器的ID ospf enable 启动OSPF协议 import-route direct 引入直联路由 ospf enable area 配置OSPF区域 标准访问列表命令格式如下: acl 默认前者顺序匹配。 rule 例: acl 10 rule normal permit source 10.0.0.0 0.0.0.25 rule normal deny source any 二、ACL配置 扩展访问控制列表配置命令 1.配置TCP/UDP协议的扩展访问列表: rule {normal|special}{permit|deny}{tcp|udp}source {《ip p=""》 《/ip》 wild》|any}destination |any} 2.配置ICMP协议的扩展访问列表: rule {normal|special}{permit|deny}icmp source { |any]destination { |any] 扩展访问控制列表操作符的含义 equal portnumber 等于 greater-than portnumber 大于 less-than portnumber 小于 not-equal portnumber 不等 range portnumber1 portnumber 区间 3.扩展访问控制列表案例 acl 10 rule deny souce any destination any rule permit icmp source any destination any icmp-type echo rule permit icmp source any destination any icmp-type echo-reply acl 10 rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0 rule deny ip source any destination any acl 103 rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www firewall enable firewall default permit|deny int e0 firewall packet-filter 101 inbound|outbound 4. NAT的配置 地址转换配置案例 firewall enable firewall default permit acl 10 rule deny ip source any destination any rule permit ip source 129.38.1.4 0 destination any rule permit ip source 129.38.1.1 0 destination any rule permit ip source 129.38.1.2 0 destination any rule permit ip source 129.38.1.3 0 destination any acl 10 rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0 rule permit tcp source any destination 202.38.160.1 0 destination-port great-than 1024 firewall packet-filter 101 inbound firewall packet-filter 102 inbound nat address-group 202.38.160.101 202.38.160.103 pool acl rule permit source 10.110.10.0 0.0.0.25 rule deny source any int serial 0 nat outbound 1 address-group pool nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp nat server global 202.38.160.102 inside 10.110.10.2 www tcp nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp nat server global 202.38.160.103 inside 10.110.10.4 smtp udp 5. PPP验证配置: 主验方:pap|chap local-user u2 password {simple|cipher} aaa interface serial 0 ppp authentication-mode {pap|chap} ppp chap user u1 //pap时,不用此句 pap被验方: interface serial 0 ppp pap local-user u2 password {simple|cipher} aaa chap被验方: interface serial 0 ppp chap user u1 local-user u2 password {simple|cipher} aaa ip http enable 开启一下 ;
1.在路由器的全局配置模式下进入F0/0接口配置模式:Router(config)intf0/02.在接口模式下配置该接口的IP地址(配置该接口的IP地址为192.168.1.1/24):Router(config-if)ipadd192.168.1.1255.255.255.03.在路由器的全局配置模式下配置静态路由(配置非直连网段192.168.10.0/24,下一跳IP为192.168.1.2):Router(config)iproute192.168.10.0255.255.255.0192.168.2
由于IPV4地址资源有限,生活中我通常用的最多的都是动态的IPv4地址。而固定的IPV4地址我们也会用到,如果我们要架设服务器,就会用到固定的IP地址,下面是我给大家整理的一些有关路由器设置固定ip地址的 方法 ,希望对大家有帮助!
路由器设置固定ip地址的方法
1、运营商拉进来的光纤信号,通常经过光纤猫,从光纤猫上拉一根网线接入高性能路由器的WAN口,用空电脑一台连接连接到路由器LAN口,我这里路由器默认网段是192.168.0.1/24,设置你电脑IP地址,右键本地连接--》属性,进入后,点击Internet协议版本4(TCP/IPV4),点击使用下面的IP地址,这里的IP地址,你可以填写192.168.0.2~192.168.0.254之前的任意一个,网关填写路由器背面默认网关,填好后点确定
2、设置好电脑IP地址后,打开CMD运行如下命令:ping 192.168.0.1,出现如图所示内容,表明电脑与路由器连接正常
3、完成以上步骤,即可在浏览器里输入路由器管理地址,通常默认用户名,密码都是admin,输入完成进入路由器管理界面
4、点击基础设置--》快速配置选项,这里类型选择静态线路(固定IP),IP地址即电信或者别的运营商给你分配的IP地址,子网掩码、默认网关、DNS也按照运营商给你分配的填写,不知道的可以打运营商电话查询,填写完成点击保存,一般我们还需要设置好DHCP,点击DHCP选项,在内网开启DHCP服务器,DHCP的起始IP地址,结束IP地址根据需要填写,只要记住跟路由器网关在一个网段内即可
5、完成以上步骤,重新启动下路由器,路由器已经保存静态路由信息,会自动连接上运营商的网络,我们进入路由器,点网络接口,会看到接口信息,表明已经连接上Internet网络,你也可以在运行CMD里输入命令:pingbaidu.com 如果有回应,表明已经连接上公网,此时即可正常上网
6、 总结 ,如果你对IP地址原理熟悉,固定IP地址的路由器设置就非常简单了。
华为路由器配置命令大全
学习华为交换机,就要记得配置基本命令,下面为大家分享的是华为路由器基本配置命令,希望对大家学习华为有所帮助!
一、计算机命令
PCAlogin:root;使用root用户
password:linux;口令是linux
shutdown-hnow;关机
init0;关机
logout;用户注销
login;用户登录
ifconfig;显示IP地址
ifconfigeth0netmask;设置IP地址
ifconfigeht0netmaskdown;禁用IP地址
routeadd0.0.0.0gw;设置网关
routedel0.0.0.0gw;删除网关
routeadddefaultgw;设置网关
routedeldefaultgw;删除网关
route;显示网关
ping;发ECHO包
telnet;远程登录
二、华为路由器交换机配置命令:交换机命令
discur;显示当前配置
displaycurrent-configuration;显示当前配置
displayinterfaces;显示接口信息
displayvlanall;显示路由信息
displayversion;显示版本信息
superpassword;修改特权用户密码
sysname;交换机命名
interfaceethernet0/1;进入接口视图
interfacevlanx;进入接口视图
ipaddress10.65.1.1255.255.0.0;配置VLAN的IP地址
iproute-static0.0.0.00.0.0.010.65.1.2;静态路由=网关
rip;三层交换支持
local-userftp
user-interfacevty04;进入虚拟终端
authentication-modepassword;设置口令模式
setauthentication-modepasswordsimple222;设置口令
userprivilegelevel3;用户级别
interfaceethernet0/1;进入端口模式
inte0/1;进入端口模式
duplex{half|full|auto};配置端口工作状态
speed{10|100|auto};配置端口工作速率
flow-control;配置端口流控
mdi{across|auto|normal};配置端口平接扭接
portlink-type{trunk|access|hybrid};设置端口工作模式
portaccessvlan3;当前端口加入到VLAN
porttrunkpermitvlan{ID|All};设trunk允许的VLAN
porttrunkpvidvlan3;设置trunk端口的PVID
undoshutdown;激活端口
shutdown;关闭端口
quit;返回
vlan3;创建VLAN
portethernet0/1;在VLAN中增加端口
porte0/1;简写方式
portethernet0/1toethernet0/4;在VLAN中增加端口
porte0/1toe0/4;简写方式
monitor-port;指定镜像端口
portmirror;指定被镜像端口
portmirrorint_listobserving-portint_typeint_num;指定镜像和被镜像
descriptionstring;指定VLAN描述字符
description;删除VLAN描述字符
;查看VLAN设置
stp{enable|disable};设置生成树,默认关闭
stppriority4096;设置交换机的优先级
stproot{primary|secondary};设置为根或根的备份
stpcost200;设置交换机端口的`花费
link-aggregatione0/1toe0/4ingress|both;端口的聚合
undolink-aggregatione0/1|all;始端口为通道号
isolate-user-vlanenable;设置主vlan
isolate-user-vlansecondary;设置主vlan包括的子vlan
porthybridpvidvlan;设置vlan的pvid
porthybridpvid;删除vlan的pvid
porthybridvlanvlan_id_listuntagged;设置无标识的vlan
如果包的vlanid与PVId一致,则去掉vlan信息.默认PVID=1。
所以设置PVID为所属vlanid,设置可以互通的vlan为untagged.
三、华为路由器交换机配置命令:路由器命令
displayversion;显示版本信息
displaycurrent-configuration;显示当前配置
displayinterfaces;显示接口信息
displayiproute;显示路由信息
sysnameaabbcc;更改主机名
superpasswrod123456;设置口令
interfaceserial0;进入接口
ipaddress;配置端口IP地址
undoshutdown;激活端口
link-protocolhdlc;绑定hdlc协议
user-interfacevty04
authentication-modepassword
setauthentication-modepasswordsimple222
userprivilegelevel3
推发布温馨提示: