自我总结——Cisco交换机和路由器配置

(1): ena
conf t
line console 0
exec-timeout 0 0
(2):line console 0
logging synchronous
(3):conf t
no ip domain-lookup
(1):配置永不超时
(2):显示同步
(3):配置禁用DNS(虚拟机上使用ctrl+shift+6:结束广播)




1:交换机配置:
开始/程序/附件/通讯/超级终端 启动交换机

Switch(config)#hostname 主机名 设置交换机主机名
Switch(config)#enable password 口令 设置交换机的使能口令
Switch(config)#enable secret 密码 设置交换机加密的使能口令
Switch(config)#line console 0
Switch(config-line)#password 密码 设置控制台console口密码
Switch(config-line)#login
Switch(config)#line vty 0
Switch(config-line)#password 密码 设置远程管理密码
Switch(config-line)#login
Switch(config)#interface vlan 1
Switch(config-if)#ip add IP地址 掩码
Switch(config-if)#no shutdown 设置交换机IP地址
Switch(config)#ip default-gateway IP地址 设置交换机的网关
Switch#vlan database
Switch(vlan)#vlan 号 name 名字 添加VLAN
Switch(config)#interface range f0/1 - 5 (范围)
Switch(config-if)#switchport access vlan 号 将端口加入VLAN
Switch(config)#interface 接口
Switch(config-if)#switchport mode trunk 设置接口模式为中继
Switch#show running-config 查看交换机的配置
Switch#show mac-address-table 查看MAC地址表
Switch#show vlan brief 查看VLAN信息
Switch#show interface 接口 switchport 查看端口的模式
Switch#show interface f0/24 查看接口状态
Switch#show ip interface brife 查看端口信息
Switch#show cdp neighbors 查看思科相连设备信息(私有协议)
Switch#show ip access-lists 查看访问控制列表
Switch#copy running-config startup-config
Switch#write 保存配置
Switch#erase startup-config
Switch#reload 恢复出厂默认值


开启三层交换机路由功能:全局模式下:ip routing
配置IP的话,先进端口,然后:no swichport

2:路由器配置



Router#clock set 小时 分钟 秒 日 月 年 设置路由器时间
Router#config terminal 进入全局模式
Router#hostname 主机名 配置路由器主机名
Router#line console 0
Router(config-line)#password 密码 配置console密码
Router(config)#enable password 密码 配置特权模式密码
Router(config)#service password-encryption 给所有的密码加密
Router(config)#banner motd $信息内容 配置路由器提示信息
Router(config)#interface 接口类型/接口号 进入接口配置模式
Router(config_if)#description ### 配置接口标识
Router(config-if)#ip address IP地址 掩码 配置接口的IP地址
Router(config)#ip route 0.0.0.0 0.0.0.0 下一跳地址 配置默认路由
Router(config)#ip route 目标网段地址 掩码 下一跳地址 配置静态路由
Rout

er(config)#interface f0/0
Router(config-if)#no shutdown
Router(config)#interface f0/0.1
Router(config-subif)#encapsulation dot1q vlan-id
Router(config-subif)#ip address ip-address subnetmask 配置单臂路由

Router(config)#router rip 开启RIP进程
Router(config-router)#version 2 设置为版本2
Router(config-router)#no auto-summary 使用RIPv2时,配置不自动汇总
Router(config-router)#network 10.0.0.0 宣告主网络号
Router#show chock 查看路由器当前时间
Router#show ip route 查看路由表
Router#show ip protocol 查看路由协议配置
Router#debug ip rip 开启RIP协议调试命令


3:删除命令
删除VLAN网关:进全局模式,然后no ip default-gateway
删除管理VLAN的IP地址:进入vlan——no ip add
删除直连路由IP地址:进入端口——no ip add
删除VLAN:进入VLAN模式,no vlan #
删除静态/默认路由:进入全局模式,no ip rout ip地址 子网掩码
删除flash中vlan.dat文件:show flash:--del vlan.dat
SW1(config-if)#switchport trunk allowed vlan remove 2 trunk中删除vlan

4:其它
远程桌面连接:开始——运行——mstsc
从主机Telnet交换机/路由器:(1):配置vty口令(2):配置enable口令
(3):telnet ip地址 【端口号】
下载路由器中的runing-config/IOS:Router#copy running-config/flash tftp
上传running-config/IOS到路由器:Router#copy tftp: running-config/flash
下载配置文件:Router#copy nvram tftp
上传配置文件到路由器:Router#copy tftp:startup-config nvram

相关文档
最新文档