思科交换机路由器配置命令大全

思科交换机路由器配置命令大全交换机基本状态 switch ROM 状态 路由器是 rommonhostna 用户模式 hostname 特权模式 hostname config 全局配置模式 hostname config if 接口状态交换机设置命令口令设置 switchenable 进入特权模式 switch configtermin 进入全局配置模式 switch config hostname 设置交换机的主机名 switch config enablesecret 设置特权加密口令 swi

思科交换机路由器配置命令大全

交换机基本状态:

交换机设置命令口令设置:
switch>enable;进入特权模式
switch#configterminal;进入全局配置模式
switch(config)#hostname;设置交换机的主机名
switch(config)#enablesecretxxx;设置特权加密口令
switch(config)#enablepasswordxxa;设置特权非密口令
switch(config)#lineconsole0;进入控制台口
switch(config-line)#linevty04;进入虚拟终端
switch(config-line)#login;允许登录
switch(config-line)#passwordxx;设置登录口令xx
switch#exit;返回命令









交换机设置命令VLAN设置:
switch#vlandatabase;进入VLAN设置
switch(vlan)#vlan2;建VLAN2
switch(vlan)#novlan2;删vlan2
switch(config)#intf0/1;进入端口1
switch(config-if)#switchportaccessvlan2;当前端口加入vlan2
switch(config-if)#switchportmodetrunk;设置为干线
switch(config-if)#switchporttrunkallowedvlan1,2;设置允许的vlan
switch(config-if)#switchporttrunkencapdot1q;设置vlan中继
switch(config)#vtpdomain;设置发vtp域名
switch(config)#vtppassword;设置发vtp密码
switch(config)#vtpmodeserver;设置发vtp模式
switch(config)#vtpmodeclient;设置发vtp模式











交换机设置命令设置IP地址:
switch(config)#interfacevlan1;进入vlan1
switch(config-if)#ipaddress;设置IP地址
switch(config)#ipdefault-gateway;设置默认网关
switch#dirflash:;查看闪存



交换机设置命令显示命令:
switch#write;保存配置信息
switch#showvtp;查看vtp配置信息
switch#showrun;查看当前配置信息
switch#showvlan;查看vlan配置信息
switch#showinterface;查看端口信息
switch#showintf0/0;查看指定端口信息





思科交换机路由器配置命令大全

路由器显示命令:

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)#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)#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 ;重新引导

静态路由:

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 路由协议。

router(config-router)#network 〈netid〉 ;设置发布路由

router(config-router)#negihbor 〈ip〉 ;点对点帧中继用。

基本访问控制列表:

router(config)#access-list 〈number〉 permit|deny 〈source ip〉 〈wild|any〉

router(config)#interface 〈interface〉 ;default:deny any

router(config-if)#ip access-group 〈number〉 in|out ;default:out

例 1:router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in

删除访问控制例表:

router(config)#no access-list 102 router(config-if)#no ip access-group 101 in

外部网关协议配置:

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置 PPP 验证:

RouterA(config)#username 〈RouterB〉 password 〈word〉

RouterA(config)#int s0 RouterA(config-if)#ppp authentication {chap|pap}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/224050.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午12:48
下一篇 2026年3月17日 下午12:49


相关推荐

  • 圣杯布局、双飞翼布局、Flex布局和绝对定位布局的几种经典布局的具体实现示例

    圣杯布局、双飞翼布局、Flex布局和绝对定位布局的几种经典布局的具体实现示例题目要求:针对如下DOM结构,编写CSS,实现三栏水平布局,其中left、right分别位于左右两侧,left宽度为200px,right宽度为300px,main处在中间,宽度自适应。要求:允许增加额外的DOM节点,但不能修改现有节点顺序。<divclass="container">  <divclass="main">main</div>  <divclass="

    2022年6月29日
    27
  • MATLAB循环_matlab如何循环计算

    MATLAB循环_matlab如何循环计算MATLAB循环1.   while循环   在给定条件为真时,重复一个语句或一组语句。它在执行循环体之前测试状态。语法MATLAB中while循环的语法是:while&lt;expression&gt;  &lt;statements&gt;end只要表达式(expression)为true,while循环将重复执行程序语句(statements)。当结果为非空并且…

    2022年10月7日
    3
  • 深度学习超分辨率重建(总结)[通俗易懂]

    本文为概述,详情翻看前面文章。1.SRCNN:—2,3改进开山之作,三个卷积层,输入图像是低分辨率图像经过双三次(bicubic)插值和高分辨率一个尺寸后输入CNN。图像块的提取和特征表示,特征非线性映射和最终的重建。使用均方误差(MSE)作为损失函数。2.FSRCNN特征提取:低分辨率图像,选取的核9×9设置为5×5。收缩:1×1的卷积核进行降维。非线性映射:用两个串联的3×3的卷积核可以…

    2022年4月1日
    43
  • 2018 java 阿里笔试题

    2018 java 阿里笔试题想进阿里的同学注意了,这里是修真院面试笔记整理,那么这里就给大家分享一下【2018java阿里笔试题】1、String,StringBuffer,StringBuilder的区别是什么?String为什么是不可变的?2、Vector,ArrayList,LinkedList的区别是什么?3、HashTable,HashMap,TreeMap区别?5、Tomcat,A…

    2025年10月14日
    4
  • 【c++】虚函数描写叙述符override

    【c++】虚函数描写叙述符override

    2021年11月28日
    41
  • 理解LSTM模型[通俗易懂]

    理解LSTM模型[通俗易懂]写在前面:这是翻译自colah的一篇博客,原文关于LSTM神经网络模型的理解写的非常直观、简单易懂,所以翻译过来帮助大家学习理解LSTM模型。当然我不是按照原文一字不落的翻译,而是摘出其中对模型理解最有帮助的部分,然后用我自己理解的方式和语言来写的博文。这是我翻译博文的一贯做法。有兴趣的可以自行去看原文,比较简短,原博客地址:http://colah.github.io/posts/2015-08-Understanding-LSTMs/一、循环神经网络RNNRNN循环神经网络使用循环核来实

    2025年10月19日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号