找回密码
 注册
搜索
热搜: java php web
查看: 469|回复: 4

[系统管理] 交换机路由器常用配置

[复制链接]
发表于 2010-4-20 16:59:14 | 显示全部楼层 |阅读模式
1.交换机配置命令
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                                               返回命令
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
switch(config-if)#switchport mode trunk              设置为trunk模式
switch(config-if)#switchport trunk encap dot1q       设置封装
交换机设置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 run                                          查看当前配置信息
switch#show vlan                                         查看vlan配置信息
switch#show interface                                   查看端口信息
switch#show int f0/0                                     查看指定端口信息
2.路由器配置命令

路由器显示命令:
router#show run                                         显示配置信息
router#show interface                                   显示接口信息
router#show ip route                                    显示路由信息
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)#ip address <ip> <netmask>       设置IP地址
router(config-if)#int f0/0.1                           进入子接口
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      默认路由举例
发表于 2010-7-13 14:37:25 | 显示全部楼层
好象这些命令太基本了吧,

评分

1

查看全部评分

回复

使用道具 举报

发表于 2010-7-13 14:40:13 | 显示全部楼层
好象这些命令太基本了吧,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|软晨网(RuanChen.com)

GMT+8, 2024-9-20 14:59

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表