CISCO IOS交换机:
1.特权模式:
switch>enable
switch#configure terminal
switch(config)#ip http server(启用HTTP)
2.主机名配置(CISCO3500):
switch(config)#hostname switch-3258
switch-3258(config)#
3.系统时间设置(CISCO3500):
switch#clock set 12:00:00 28 August 2013
4.设备管理ip地址配置(CISCO3500):
switch(config)#interface vlan1
switch(config-if)#ip address 192.168.1.1 255.255.255.0 //ip+mask
switch(config-if)#exit
5.端口配置(CISCO3500):
switch(config)#interface f0/1 //进入f0/1端口
switch(config-if)#no shutdown //开启端口
switch(config-if)#duple full/auto //设置全双工/自动
switch(config-if)#speed 100 //端口速率100M
6.vlan配置(catalyst3500):
switch#vlan database //vlan配置模式
switch(vlan)#vlan 100 name vlan0010 //创建vlan10命名
switch(vlan)#no vlan 100 //删除vlan100
switch(vlan)#vlan 100 name VLAN0010 //改名vlan100
switch(config)#int f0/1 //进入f0/1端口
switch(config-if)#switchport access vlan100 //配置连入vlan100
switch(config)#int f0/24 //进入f0/24端口
switch(config-if)#switchport mode trunk //进入trunk模式
switch(config-if)#switchport trunk encapsulation dotlq //dotlq协议
switch(config-if)#switchport trunk allowed vlan 1,10 //设置允许中继的vlan 1和10,1到10,除了1和10
switch(config-if)#switchport trunk allowed vlan 1-10
switch(config-if)#switchport trunk allowed vlan except 1,10
7.vtp配置(CISCO IOS):
switch(config)#vtp domain test //设置vtp域名test
switch(config)#vtp mode server/client/transparent //设置模式
8.stp配置:
cisco3500基础stp:
switch(config)#spanning-tree vlan 100 //启用
switch(config)#spanning-tree vlan100 root primary //根网桥
switch(config)#spanning-tree vlan100 root secondary //备份网桥
switch(config)#spanning-tree vlan3 priority 8192 //VLAN3优先级为8192
增强stp mode:
switch(config)#spanning-tree portfast default ///PortFast:catalyst 3528
switch(config)#spanning-tree uplinkfast //UplinkFast:catalyst 3500
switch(config)#spanning-tree uplinkfast max-update-rate 32000 //max-updata-rate 范围0-32000,单位packet/s
switch(config)#spanning-tree backbonekfast //BackboneFast:catalyst 3500
switch(config)#spanning-tree portfast bpdufilter default //Bpdufilter
CISCO OS交换机:
1.特权模式:
switch>enable
siwtch>(enable)set ip http server enable(启用HTTP)
2.主机名配置(Catalyst6500):
switch>(enable)set system name XXX
system name set
3.系统时间设置(Catalyst6500):
switch>(enable)set time Wed 8/28/2013 12:00:00
4.设备管理ip地址配置(Catalyst6500):
switch>(enable)set interface sc0 192.168.1..2541 255.255.255.0 192.168.1.255 //ip,mask,broad
switch>(enable)set ip route 0.0.0.0 192.168.1.254 //0.0.0.0+默认路由
5.端口配置(Catalyst6500):
switch>(enable)set port enable 0/1 //开端口0/1
switch>(enable)set port duplex 0/1 full //0/1全双工
switch>(enable)set port duplex 0/1-24 full //0/1-0/24全双工
switch>(enable)set port speed 0/1 100 //0/1速率100M
switch>(enable)set port speed 0/1-24 auto //0/1-0/24速率自动
6.vlan配置(catalyst6500):
switch>(enable)set vlan 100 name vlan0010 //设置vlan100命名
switch>(enable)clear vlan 100 //删除vlan100
switch>(enable)set vlan 100 name VLAN0010 //改名
switch>(enable)set vlan 100 0/1 //0/1放入vlan100
switch>(enable)set trunk 1/24 on dotlq Port(s) 1/24 trunk mode set to on
switch>(enable)set trunk 1/24 vlan 11-20
switch>(enable)clear trunk 1/24 vlan 11-20
7.vtp配置(CAT OS):
switch>(enable)set vtp domain test
switch>(enable)set vtp mode server/client/transparent/off
8.stp配置(catalyst 6500):
switch>(enable)set spantree enable 100
switch>(enable)set spantree root 1,100-200
switch>(enable)set spantree secondary 1,100-200
switch>(enable)set spantree priority 8192
switch>(enable)set spantree portfast 1/24 enable
switch>(enable)set spantree portfast 2/1-24 enable
switch>(enable)set spantree uplinkfast enable
switch>(enable)set spantree uplinkfast enable rate 20
switch>(enable)set spantree backbonefast enable
switch>(enable)set spantree portfast bpdu-filter enable
switch>(enable)set spantree portfast bpdu-filter 1/1-24 enable
switch>(enable)set spantree portfast bpdu-filter 2/1 default
路由器:
1.路由基本信息配置:
Router(config)#hostname router
router(config)#calendar set 20:26:00 3 may 2013
router(config)#show flash/version/clock/configuration/ip route/ip protocols
查看flash信息/软硬件版本/系统时钟/路由器配置文件/路由表/ip路由协议
2.路由接口配置:
router(config)#interface f0/1
router(config-if)#bandwidth 100000
router(config-if)#ip address 192.168.1.254 255.255.255.0
router(config-if)#no shutdown
环回(loopback)接口配置:
router(config)#interface loopback 0
router(config-if)#ip address 192.168.100.1 255.255.255.255
router(config-if)#no ip route - cache //禁用route-cache
3.局域网接口配置:
标准以太网:
router(config)#interface Ethernet1
router(config-if)#description To -lab1
router(config-if)#ip address 192.168.1.1 255.255.255.0
router(config-if)#bandwidth 10000
router(config-if)#no shutdown
router(config-if)#end
快速以太网配置:
router(config)#interface fastethernet
router(config-if)#description To-lab2
router(config-if)#ip address 192.168.2.1 255.255.255.0
router(config-if)#bandwidth 100000
router(config-if)#duplex half
router(config-if)#no ip directed - broadcast
router(config-if)#no ip proxy -arp
router(config-if)#no shutdown
千兆以太网接口配置:
router(config)#interface GigabitEthernet0/0
router(config-if)#description To -lab3
router(config-if)#ip address 192.168.3.1 255.255.255.0
router(config-if)#bandwidth 1000000
router(config-if)#duplex full
router(config-if)#no ip directed -broadcast
router(config-if)#no ip proxy -arp
router(config-if)#no shutdown
4.广域网接口配置:
异步串行接口配置:
router(config)#interface Async1
router(config-if)#ip unnumbered ethernet0
router(config-if)#encapsulation ppp
router(config-if)#async default ip address 192.168.1.1
router(config-if)#async dynamic routing
router(config-if)#async mode interactive
router(config-if)#no shutdown
高速同步串行接口:
router(config)#interface Serial0/0
router(config-if)#description To-lab4
router(config-if)#bandwidth 2048
router(config-if)#ip address 192.168.4.1 255.255.255.252
router(config-if)#encapsulation ppp
router(config-if)#no ip directed -broadcast
router(config-if)#no ip proxy -arp
router(config-if)#no shutdown
pos接口的设置:
router(config)#interface POS0/1
router(config-if)#description To -lab5
router(config-if)#bandwidth 10000000
router(config-if)#ip address 192.168.5.1 255.255.255.252
router(config-if)#crc 16
router(config-if)#no ip directed -broadcast
router(config-if)#pos flag s1 s0 0
router(config-if)#no shutdown
5.静态路由配置命令:
router(config)#ip route 10.0.0.0 255.0.0.0 192.168.1.1
//目的网络地址 子网掩码 下一条路由ip地址
6.rip:
router1(config)#router rip
router1(config-router)#network10.1.1.0
router1(config-router)#network20.1.1.0
router2(config)#router rip
router2(config-router)#network10.1.1.0
router2(config-router)#network30.1.1.0
7.ospf:
router(config)#router ospf 10
router(config-router)#network 192.168.1.0 0.0.0.255 area 0 //子网号 子网掩码
检查:
router#debug ip ospf events
router#show ip ospf neighbor
router#show ip protocols
router#show ip ospf
router#show ip ospf interface e0