路由器、交换机配置命令及模拟软件中的实验内容

路由器、交换机配置命令
计算机命令:
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>                            ;建立telnet之前先ping一下
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
交换机基本状态:
switch:                                            ;ROM状态, 路由器是
rommon>
溶菌酶
hostname>                                          ;用户模式
hostname#                                          ;特权模式
hostname(config)#                                  ;全局配置模式
hostname(config-if)#                                ; 接口状态
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
交换机口令设置:
switch>enable                                      ;进入特权模式
switch#config terminal                              ;进入全局配置模式
switch(config)#hostname <hostname>                  ;设置交换机的主机名
switch(config)#enable secret xxx                    ;设置特权加密口令为 xxx
switch(config)#enable password xxx                  ;设置特权非密口令为 xxx
switch(config)#line console 0                      ;进控制台口(Rs232)初始化
switch(config-line)#line vty 0 4                    ;进入虚拟终端virtual tty
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          ;当前端口1加入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 <name>                    ; 设置发vtp域名
switch(config)#vtp password <word>
switch(config)#vtp mode server
switch(config)#vtp mode client
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
交换机设置IP地址:
switch(config)#interface vlan 1                    ;进入vlan 1
switch(config-if)#ip address <IP> <mask>            ;添加远程登录IP 曼彻斯特编码
switch(config)#ip default-gateway <IP>              ;添加默认网关
switch#dir flash:                                  ;查看内存
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
交换机显示命令:
switch#write                                        ;写入保存
switch#show vtp
switch#show run                                    ;查看当前配置信息
switch#show vlan                                    ;看VLAN
switch#show interface                              ;显示所有端口信息
switch#show int f0/0                                ;显示端口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)#enable secret xxx                    ;设置特权加密口令为 xxx
router(config)#enable password xxx                  ;设置特权非密口令为 xxx
router(config)#line console 0                      ;进控制台口(Rs232)初始化
router(config-line)#line vty 0 4                    ;进入虚拟终端virtual tty
router(config-line)#login                          ;允许登录
router(config-line)#password xx                    ;设置登录口令xx
马旭初
router(config)# (Ctrl+z)                            ; 返回特权模式

本文发布于:2024-09-21 22:44:31,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/45012.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:设置   显示   交换机   进入
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议