1. 基本操作
enable
disable
logout
reload 重新启动路由器
configure memory //同copyrunning-config startup-config
configure network //同copyrunning-config ftp
show terminal 检验终端历史命令记录的大小
show history 查看输入的20条历史命令
show version 查看路由器基本信息
show ip interface brief 显示接口摘要
erase startup-config删除路由器所有配置
show startup-config
show running-config 重新查看配置是否删除
show flash
show users 查看用户
show clock
show hosts
show protocols 查看物理层数据链路层的状态
show controllersinterface 0/0 显示物理接口自身的信息
show interface 0/0 显示接口状态信息
以上两个命令可以查看路由器DTE状态
2. 路由器通过修改寄存器来恢复密码
Router>show version
默认值为0X2102
在不丢失路由器原有配置的情况下,利用超级终端恢复遗忘的路由器密码的方法:
连接路由器启动超级终端程序并对相关项进行设置并进入对话框,
首先关闭路由器电源,后打开路由器电源在路由器重起的前十秒钟之内CTRL+BREAK组合键执行一个中断后,出现诊断提示符
Rommon 1 >
Rommon 1 >confreg0x2142 修改寄存器的值跳过启动配置文件
Rommon 2 >reset 重新启动路由器
在路由器启动后要退出向导提示符 N 然后回车
Router >enable
Router #
Router #copy startrun 将启动配置文件恢复到运行配置文件之中
Router #conf t
Router(config)#enable secret c1 将加密号令改为C1
Router(config)#config-register 0x2102 将寄存器值设置为默认值
Router #copy runstart 将运行配置文件拷贝到启动配置文件中
Router #reload 重新启动路由器
试验路由器C1密码是否成功,注意两点:物理连接在中路由器上,把寄存器值设置回默认值
交换机:
交换机的模式按钮(重新启动时),进入
Switch :
Switch :flash init 对闪存进行初始化
Switch :Load_helper
Swiitch:dir flash:查看闪存中的文件列表
Switch:renameflash:config.text flash:config.back 将配置文件改名
Switch:boot 重新启动交换机
过程中取消向导提示 N
Switch >
Switch >enable
Switch >renameflash:config.back flash:config.text 将闪存中配置文件还原
Switch >copyflash:config.text system:running config 将闪存中配置文件恢复到运行配置文件夹中
Switch >conf t
Switch(config)#enable secret cisco 将密码改为CISCO
Switch (config)#end
Switch#copy runstart 将运行配置文件存盘
Switch#reload 重新启动交换机验证密码
Switch#disable
Switch >enable
输入修改后的密码以验证
router#config-register 0x2101 路由器重新启动时从闪存中启动IOS
router#show flash 查看闪存状态
router#reload
router#config-register 0x2102 恢复路由器重新启动时从NVRAM中启动IOS
router#reload
router#copy startup-configrunning-config 把NVRAM拷贝到闪存中
router#boot system flash ………..bin 查看路由器从闪存中启动文件
router#boot system tftp …………. Bin 1.1.1.2 (ftp—ip) 查看路由器从TFTP启动文件
如果两个都找不到不成功最后一步从ROM加载IOS
router#boot system rom 从ROM加载IOS
router#copy flash tftp
router#copy tftp flash 备件、恢复/升级IOS
通过IOS文件系统管理路由器配置:
router#show file informationnvram:startup-config
router#cd nvram
router#pwd
router#dir
router#cd system:
router#pwd
router#dir
router#config net
router#copy tftp://1.1.12/todd-configsystem://running-config
思科发现协议CDP
corp#cdp run 打开路由器的CDP
corp#no cdp run 关闭路由器的CDP
corp#sh cdp
corp#cdp holdtime ? 设置CDP的保持时间
corp#cdp timer 120 设置CDP的定时器
corp#show cdp neighbors detail查看核心路由器的邻居路由器概要(直连)
corp#show cdp entry * protocols 同上
corp#show cdp entry * version 显示直连设备的IOS版本
corp#show cdptraffic 显示接口流量信息
cprp#show cdp interface 显示端口CDP状态
no cdp enable 关闭接口的每个CDP
cdp enable 打开接口的每个CDP
corp#show running-config
corp#do show cdpneighbors 接口另一端类型从而通过收集到的信息建立拓朴图
3. 基本配置
Router(config)#hostname route2
route2(config)#enable secret zhbl2
Route2(config)#int serial 1/0
Route2(config-if)#description to route 3 s0/1
Route2(config-if)#ip address 172.16.10.3 255.255.255.0
Route2(config-if)#no shut
Route2#show ip interface brief
route2#show controllers serial 1/0
route2(config)#cdp run -------------全局global
route2(config)#no cdp run
route2#show cdp
route2(config)#int serial 1/0 -------接口Interface
route2(config-if)#cdp enable
route2(config-if)#no cdp enable
route2(config-if)#end
route2#show cdp interface
route2#show cdp neighbors
route2#show arp 只能端口和协议都UP了才可显示出来
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.1.1.2 - 000C.4361.1005 ARPA Ethernet0/0
控制台设置
router(config)#line con 0
router(config-line)#passwordconsole
router(config-line)#login
router(config-line)#loggingsynchronous 登陆同步不会有消息打乱情况发生
router(config-line)#exec-timeout 00 决不超时默认10分钟
辅助端口设置
Router(config)#line aux 0
Router(config-line)#password aux
Router(config-line)#login
Router(config-line)#exit
远程telnet设置
Router(config)#line vty 0 1180
Router(config-line)#passwordtelnet
Router(config-line)#login
Router(config-line)#exit
Router(config)#no ipdomain-lookup 错误命令后不再端口广播
Router(config)#banner motd # thisis my corp 2811 isr router # 标记给予试图登陆都以警告
Router#copy running-configstartup-config
Router#show controllers s0/0/1 查看所使用的时钟DCE中
Router#show ip route 查看路由表
4. 路由配置
无线路由静态
Router(config)#int dotllradio0/3/0
Router(config-if)#ip address 10.1.8.1255.255.255.0
Router(config-if)#descriptionadmin wlanl
Router(config-if)#ssid admin 接入点通信管理
Router(config-if-ssid)#guest-mode 说明此接口将广播这个SSID
Router(config-if-ssid)#authenticationopen 自动验证是打开的(没有认证)
Router(config-if-ssid)#infrastructure-ssid 说明此接口可以允许其它接入点进行通信
Router(config-if-ssid)#no shut
无线路由动态DHCP
Router(config)#ip dhcp pool admin
Router(dhcp-config)#network 10.1.8.0255.255.255.0 动态路由
Router(dhcp-config)#default-router10.1.8.1 缺省路由区别于静态就是接口IP
Router(dhcp-config)#exit
router(config)#ip dhcpexcluded-address 10.1.8.1 排除地址
默认路由
router(config)#ip default-network 10.1.1.25 缺省路由
router(config)#ip route 0.0.0.00.0.0.0 s0/0 最高优先级
router(config)#ip route 0.0.0.00.0.0.0 10.1.1.25
router(config)#ip classless 无类别路由,每个静态路都要跟配
动态路由RIP
router(config)#router rip
router(config-router)#network 10.1.1.25
router(config-router)#passive-interfaceserial 0/0 被动接口禁止RIP更新从接口广播出去
router(config-router)#version2 RIP v2启用
router(config-router)#
动态路由EIGRP/IGRP
router(config)#router igrp/eigrp
router(config)#router 10.1.1.25
router#sh ip protocols 查看路由器另一网络的输出
router#debug iprip/eigrp/igrp 发送/接收,路由更新消息时把信息发送到控制台
EIGRP距离矢量/链路状态的综合(增强IGRP)
Router(config)#router eigrp 20 HELLO报文更新
Router(config-router)#network 10.1.1.25
Router(config-router)#passive-interfaceserial 0/0 被动接口禁止路由更新从接口广播出去
从RIP 到EGIGRP
router(config-router)#redistributerip metric 10000000(带宽) 2000(delay)255(effective)
1(路径) 1500(最大传输单元)
//重新分布路由协议设置一些选项
router(config)#do show run | beginrouter eigrp 20
从EIGRP到RIP
router(config)#router rip
router(config-router)#redistributereigrp 10 metric 1 (路径)
router(config)#no router rip
cliect(config)#no router rip //在所有的路由器上禁用rip 路由协议
如果是老型号只支持RIP
router1(config)#router eigrp 100
router1(config-router)#network172.16.0.1
router1(config-router)#network 10.0.0.1
router1(config-router)#noauto-summary 在这个路由器上不自动运行summary概要
router2(config)#router eigrp 100
router2(config-router)#network172.16.0.1
router2(config-router)#network 10.0.0.1
router2(config-router)#noauto-summary
验证EIGRP
router(config)#show ip route
router(config)#show ip routeeigrp 查看路由表中EIGRP项目
router(config)#show ip eigrpneighbors 查看路由表中EIGRP协议的邻里路由器
router(config)#show ip eigrptopology 查看路由表中的拓朴图项目
router(config)#debug eigrppacket 查看路由器表中的发送接收的HELLO报文
router(config)#debug eigrpnotification 查看路由器间的更新的内容,通告
OSPF配置
Corp(config)#no router eigrp10 在核心路由器上删除EIGRP协议
Corp(config)#router ospf 132 启用OSPF协议
Corp(config-router)#network 10.1.0.00.0.255.255 area 0
R1(config)#no router eigrp 10 在分支路由器上删除EIGRP协议
R1(config)#router ospf 132
R1(config-router)#network 10.1.0.00.0.255.255 area 0
验证OSPF配置
Corp#show ip route 查看路由表
Corp#show ip ospf 查看OFPF信息
Corp#show ip ospf database 查看OSPF拓朴数据库
Corp#show ip ospf interface 查看所有OSPF接口
Corp#show ip ospf neighbor 查看邻居接口状态信息
Corp#show ip protocols 查看当前运行协议概叙
调试OSPF
Corp#debug ip ospf packet 查看路由器发送和接收的HELLO数据包
Corp#debug ip ospf hello 同上但详细些
Corp#debug ip ospf adj 在广播、非广播网络上发生的情况除点到点
OSPF的环回接口(1) 路由器协议进程中总有一个激活的接口
Corp(config)#int loopback 0 进入环回接口
Corp(config-if)#ip address172.16.10.2 255.255.255.255
Corp(config-if)#reboot
R1(config)#intloopback 0
R1(config-if)#ip address172.16.10.3 255.255.255.255
R1(config-if)#reboot
Corp(config)#show ip ospf
Routering process “ospf 132” with id 172.16.10.2 在这里会发现RID 改过来了
OSPF环回接口(2)
corp#show ip ospf
corp(config)#router ospf 132
corp(config)#router-id172.16.10.2 添加一个OSPF进程(不用重起路由器即生效)
corp(config-router)#do clear ipospf process 清除OSPF进程
corp(config-router)#do sh ipospf 查看OSPF的RID
corp(config)#int loopback 0 配置环回地址
corp(config-if)#ip address172.16.10.5 255.255.255.255
corp#reboot
corp#show ip ospf 查看OSPF的RID
OSPF接口的优先级
R1(config)#int f0/0
R1(config-if)#ip ospf priority 4
R1(config-if)#do show ip ospf intf0/0
OSPF故障诊断
R1(config)#router ospf 132
R1(config-router)#network 10.0.0.00.255.255.255 area 0 查看OSPF通配符是否正确
R1#show ip ospf interface e0/0
R2#show ip ospf interfacee0/0 查看OSPF接口状态判断两台路由器为什么不能邻接
EIGRP/OSPF汇总路由(在主干路由器上汇总)
Corp(config)#router ospf 1
Corp(config-router)#network192.168.10.64 0.0.0.3 area 1 反掩码
Corp(config-router)#network192.168.10.88 0.0.0.3 area 1 反掩码
Corp(config-router)#network 10.10.10.00.0.0.255 area 0 反掩码
Corp(config-router)#area 1 range192.168.10.64 255.255.255.224 将area 1汇总到area0中
Corp(config-router)#area 1 range192.168.10.88 255.255.255.224 将area 1汇总到area0中
5. STP生成树协议和二层交换
switch#show mac address-table 显示交换机MAC地址表
端口安全
一个端口接一台计算机
switch(config)#int f0/1
switch(config-if)#switchportport-security maximum 1
switch(config-if)#switchportport-security violation shutdown
我更喜欢这条命令
switch(config)#int f0/1
switch(config-if)#switchport port-securitymac-address sticky 不管命令设置时间长度如何,都将保持不变
switch(config-if)#switchport port-secutitymaximum 2
switch(config-if)#switchportport-secutity violation shutdown
生成树协议STP
选取根桥:要优先级与MAC地址结合起来,同样的优先级就先MAC地址最小的
STP过程中,选取关闭端口时,要带宽值(100mb/s、1000mb/s)高的那一条;
被关闭端口还可以接收但不会转发
改变默认的优先级是选取根桥的最佳方式因为这一点很重要,我们希望核心交换机(离网络中心最近的交换机)成为根桥,这样STP会快速收敛
switch(config)#do showspanning-tree 优先级默认为32768
switch(config)#spanning-tree vlan1 priority 4096
switch(config)#do showspanning-tree 查看会看到priority 4097 (由在4096递增)
switch(config)#int rangefastethernet 0/1-12
switch(config)#description fast0/1-12 to cliect 端口描述
switch(config-if-range)#spanning-treeportfast 配置生成树快速端口(必须在禁用STP时不会产生交换环路也就是网络中无环路情况下)
switch(config-if-range)#spanning-treebpduguard enable 生树快速端口上配置并且只能在接入层交换机上配置,为了访止另外交换机接在快速端口时此端口会成为禁用状态
switch(config-if-range)#spanning-treebpdufilter enable 将使端口错误后,还是保持打开但是不运行portfast
扩展配置
switch(config)#spanning-treeuplinkfast 在本地交换机检测链路失效并快速修复
switch(config)#do showspanning-tree uplinkfast
switch(config)#spanning-treebackbonefast 在远程交换机检测链路失效
switch(config)#do showspanning-tree backbonefast 查看它是否配置
switch(config)#spanning-tree moderapid-pvst 生成树模式快速生成
switch(config)#do showspanning-tree 查看生成树协议状态
验证交换机的配置
Switch#show int vlan 1
Switch#show mac address-table
Switch(config)#mac-address-tablestatic aaaa.bbbb.cccc vlan 1 int fa0/5 分配静态IP地址
Switch(config)#do show macaddress-table
Switch#show spanning-tree
6. VLAN虚拟局域网
VTP中继协议
Vtp在交换机之间传送vlan信息必须满足以下三个条件:
域名必须是一样的
其中一台交换机必须设置为VTP服务器
不需要路由器
交换机必须在服务器模式下才能在VTP中创建添加删除VLAN,客户机中不能做任何的改动只能接收发送只能学习传递VTP信息客户机配置不保存在NVRAM中
VTP修剪
Vlan1不支持修剪,负责管理vlan
Vlan2-1001支持修剪的有效VLAN,vlan1002-1005是所有交换机自动创建的且不能删除
Vlan1006-4096为扩展vlan不能被修剪;修剪是为了减小广播,组播,单播数量从而来保存带宽
Switch#show int trunk 查看所有默认时穿越中继线路的VLAN,vtp修剪是否启动
Switch(config)#int f0/1
Switch(config-if)#switchport trunkpruning vlan 3-4 VLAN 3-4启动了VTP修剪
VLAN之间的路由
单臂路由,最好是高端交换机,低端会有瓶颈,单点失效,取决于流量情况
配置VLAN
Switch(config)#vlan 2
Switch(config-vlan)#name sales 创建VLAN
Switch#show vlan
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan2 将交换机端口分配到vlan 2中
配置中继端口
Switch(config)#int fa0/8
Switch(config-if)#switchport mode trunk 永久性的中继模式
Switch(config-if)#switchport mode dynamicauto 相对于邻居状态而言,邻居中继则自动
Switch(config-if)#switchport mode access/trunk
Switch(config-if)#switchport nonegotiate 防止接口产生DTP(动太中继)帧,
mode access/trunk时使用
3560交换机上配置中继端口
Core(config-if)#switchport trunk encapsulation dot1q 封装
Core(config-if)#switchport mode trunk
在中继端口上定义允许的VLAN
Switch(config-if)#switchport trunk allowedvlan remove 4-8 中继链路上移动vlan4,丢弃所有从vlan4-8发送接收的流量
Switch(config-if)#switchport trunk allowedvlan all
Switch(config-if)#no switchport trunk allowedvlan 不小心删除了,可以恢复中继默认值
Switch(config)#int f0/1
Switch(config-if)#switchport trunknative vlan 40 变更中继端口,本机vlan 1改为40
Switch(config)#show running-config 如果错误就到另一端变更,不要忘了
Switch(config-if)#no switchport trunk nativevlan 将本机VLAN设置为默认值
单臂路由(子接口)
在配置路由器之前要设计逻辑网络
Vlan 1:192.168.10.16/28
Vlan 2:192.168.10.48/28
Router(config)#int f0/0
Router(config-if)#on ip address
Router(config-if)#no shutdown
Router(config-if)#int f0/0.1
Router(config-subif)#encapsulation dot1q 1
Router(config-subif)#ip address 192.168.10.17255.255.255.240
Router(config-if)#int f0/0.2
Router(config-subif)#encapsulation dot1q 2
Router(config-subif)#ip address 192.168.10.49 255.255.255.240 此ip地址根据网络主
机数配置以最大值 (使用主机范围中的任何一个地址都是可以有只是必须正确配置主机
的默认网关应当与路由器ip 地址一致)
2960Switch(config)#int f0/1
2960Switch(config-if)#switchport mode trunk
2960Switch(config)#int f0/2
2960Switch(config-if)#switchport access vlan 1
2960Switch(config)#int f0/3
2960Switch(config-if)#switchport access vlan 2
2960switch(config)#int vlan 1 因为交换机只有一个管理vlan
2960switch(config-if)#ip address 192.168.10.18255.255.255.240
2960switch(config)# 默认网关
2960switch(config-if)#no shutdown
配置VTP
Core(config)#vtp mode server
Core(config)#vtp domain lammle
Core(config#vtp password todd
Core(config)#do show vtp password
Core(config)#do show vtp status 服务器端显示VTP状态
Client(config)#vtp mode client
Client(config)#vtp password todd
Client(config)#do show vtp status
Client#show vlan brief 显示VLAN大纲
VTP故障排除
Switch#show vtp status 交换机要保存VLAN就要设置成VTP服务器
配置语音VLAN
Switch#configure terminal
Switch(config)#mls qos 全局范围内启用qos
Switch(config)#int f0/1
Switch(config-if)#switchport priority extendtrust 优先扩展信任
Switch(config-if)#mls qos trust cos 将接口配置为对进入的数据包进行流量分级
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3 访问VLANvlan 3
Switch(config-if)#switchport voice vlan 10 语音VLANvlan 10
安全
非军事区、防火墙、内网路由器,面对不安全的因素我们采用防火墙和访问控制列表来保护内部网络
7. ACL访问控制列表
通配符 172.16.30.0 0.0.0.255表示精确匹配前三个八位组,第四个八位组可以是任意的
例corp(config)#access-list 10 deny 172.16.64.0 0.0.63.255
表示从172.16.64.0开始,持续64个块,到172.16.127.0(64+63=127)
Any命令和通配符0.0.0.0 255.255.255.255是一样的
标准访问控制列表(1-99)
例:阻止用户访问财务部VLAN
Lab_a#config t
Lab_a(config)#access-list 10 deny 172.16.40.0 0.0.0.255 取决于有多少个用户
Lab_a(config)#access-list 10 permit any(0.0.0.0255.255.255.255)
Lab_a(config)#int e1 e1口的出口方向
Lab_a(config-if)#ip access-group 10 out 放在靠近目的地点的接口上
例:阻止四个LAN访问互联网
Router(config)#access-list 1 deny 172.16.128.00.0.31.255
Router(config)#access-list 1 deny 172.16.48.0 0.0.15.255
Router(config)#access-list 1 deny 172.16.192.00.0.63.255
Router(config)#access-list 1 deny 172.16.88.0 0.0.7.255
Router(config)#access-list 1 permit any
Router(config)#int serial 0
Router(config-if)#ip access-group 1 out 放在serial0 的出口方向
控制VTY(telnet)访问
例:只允许一台主机172.16.10.3远程登陆到路由器
Lab_a(config)#access-list 50 permit172.16.10.3
Lab_a(config)#line vty 0 4
Lab_a(config-line)#access-class 50 in 只有试图登陆到路由器的包才会被查看
扩展访问控制列表(100-199)
例:拒绝访问172.16.30.5服务器上的telnet 和ftp
lab_a#config t
Lab_a(config)#access-list 110 deny tcp anyhost 172.16.30.5 eq 21
Lab_a(config)#access-list 110 deny tcp anyhost 172.16.30.5 eq 23
Lab_a(config)#access-list 110 permit ip anyany
Lab_a(config-if)#access-group 110 out 放在靠近目的地的接口方向
例:防止telnet远程登陆e1、e2接口的连接的网络
Router(config)#access-list 110 deny tcp any172.16.48.0 0.0.15.255 eq 23
Router(config)#access-list 110 deny tcp any172.16.192.0 0.0.63.255 eq 23
Router(config)#int e 0/1
Router(config-if)#ip access-group 110 out
Router(config)#int e 0/2
Router(config-if)#ip access-group 110 out
高级访问控制列表
命名(路由器)访问控制台列表(acl)
例:阻止用户访问财务部VLAN
Lab_a#config t
Lab_a(config)#ip access-list standard blocksales 列表名称
Lab_a(config-std-nacl)#deny172.16.40.0 0.0.0.255
Lab_a(config-std-nac1)#permitany
Lab_a#showrunning-config 查看访问控制列表是否改变
Lab_a(config)int e 0/1
Lab_a(config-if)#ipaccess-group blocksales out 放在靠近目的地的接口方向
端口(交换机)访问控制列表(acl) 这是不同于路由器的地方
三个原则:acl只支持二层物理接口,应用在接口的入口上,只能使用命名的列表
例:在一个特定环境中拒绝MAC地址
Switch(config)#mac access-list extended todd_mac_list 列表名称
Switch(config-ext-macl)#deny any host 000d.29bd.4b85 硬件地址
Switch(config-ext-macl)#permit any any
Switch(config-ext-mac1)#do show access-list
Switch(config-ext-mac1)#int f0/6
Switch(config-if)#mac access-group todd_mac_list in
例:基于时间的访问控制列表
Corp#config terminal
Corp(config)#time-rangeno –http
Corp(config-time-range)#periodic weekend 06:00to 12:00 周期性的周末六点到十二点
Corp(config)#time-rangetcp-yes
Corp(config-time-range)#periodic weekend 06:00to 12:00 周末的这个时间
Corp(config)#ip access-list extended time
Corp(config-ext-nac1)#deny tcp any any eq www time-range no-http
Corp(config-ext-nac1)#deny tcp any any time-range tcp-yes
Corp(config-ext-nac1)#int f 0/0
Corp(config-if)#ip access-group time in
Corp(config-if)#do show time-range
注释 (可以在任何位置插入)
corp(config-if)#Remark deny all ofsales from telnetting 注解 禁止销售部门telnet应用
基于上下文的访问控制(CISCO IOS 防火墙)
略
监控访问列表
Lab_a#show access-list 110 查看访问控制列表参数
Lab_a#show ip interface e0/1 查看那些接口设置了访问列表
Lab_a#show mac access-group 查看交换机MAC访问列表
Lab_a#show ip access-list 查看路由器上配置ip 访问列表
Lab_a#show running-config 查看访问列表和那些接口设置访问列表
8. NAT网络地址转换
三种类型
静态,一对一;动态,ip地址池;复用,多对一;
略
NAT的验证
Router#show ip nattranslation 查看NAT翻译结果
Router#debug ip nat 验证NAT配置
Router#clear ip nat translation * 从表中清除NAT 条目
Router#show ip nat statistics 查看NAT统计
9. VPN网络的搭建和路由设置
略
IPv6配置
静态
Corp(config)#IPv6 unicast-routing 启用IPv6流量转发
Corp(config-if)#IPv6 address 2001:db8:3c4d:1:0260.d6ff.fe73.1987/64 接口添加ip地址
Corp(config-if)#IPv6 address 2001:db8:3c4d::/64 eui-64 允许设备使用MAC地址并填充
Corp(config)#IPv6 enable 只能与本地子网进行通信
动态DHCP
Router(config)#IPv6 dhcp pool test 建立DHCP池
Router(config-dhcp)#dns-server ? dns服务器
Router(config-dhcp)#domain-namelammle.com 域名设置
Router(config-dhcp)#prefix-delegationpool test lifetime 3600 3600 称谓代表团池生存期
无穷大
Router(config)#int fa 0/0
Router(config-if)#IPv6 dhcp servertest 把DHCP放在某个接口上
IP v6路由协议
RIPng:
Router(config-if)#ipv6 rip 1 enable 在接口上直接启用IPv6 标记
Router(config)#ipv6 router rip 1 在路由器全局配置下启用IPV6
EIGRPv6:
Router(config)#ipv6 router eigrp 10
Router(config-rtr)#no shutdown
Router(config-if)#IPv6 eigrp 10 接口下启用EIGRP
OSPFv3:
Router1(config)#ipv6 router ospf 10 全局启用IPv6OSTP
Router1(config)#router-id 1.1.1.1 配置路由
Router1(config-if)#IPv6 ospf 10 area 0.0.0.0 接口配置内容
双栈技术
Corp(config)#ipv6 unicast-routing 启用IPv6转发
Corp(config)#int fast 0/0
Corp(config-if)#IPv6 address 2001:db8:3c4d:1::/64 eui-64
Corp(config-if)#ip address 192.168.255.1255.255.255.0 IPv6添加ipv4接口上两版本
6to4 隧道技术
Router1(config)#int tunnel 0 进入隧道0
Router1(config-if)#IPv6 address2001:db8:1::1/64 接口IP
Router1(config-if)#tunnel source 192.168.30.1 隧道源IP
Router1(config-if)#tunnel destination192.168.40.1 隧道目的IP
Router1(config-if)#tunnel mode ipv6ip IPV6隧道模式
Router2(config-if)#int tunnel 0
Router2(config-if)#ipv6 address2001:db8:2::1/64
Router2(config-if)#tunnel source 192.168.40.1
Router2(config-if)#tunnel destination192.168.30.1
Router2(config-if)#tunnel mode ipv6ip
验证
Corp#show ipv6 route
Corp#sh ipv6 rip 验证RIPng
Corp#debug ipv6 rip 调试RIPng
Corp#show ipv6 interface serial 0/0/1 查看接口状态
Corp#sh ipv6 protocols 查看IPV6协议状态
Corp#sh ipv6 ospf neighbor 查看ipv6ospf邻里状态
Corp#debug ipv6 ospf packet 调试ospfipv6包状态
Corp#debug ipv6 ospf hello 调试ospfipv6hello报文
Corp#un all
10. 广域网配置
HDLC 高级数据链路控制协议
PPP点到点协议
Frame-relay 帧中继
例PPP:
Router(config)#hostname router1 为自己建立名称
Router1(config)#username router2password cisco 为对方路由器建立名称、密码
Router1(config)#Interface serial 0
Router1(config-if)#ip address 10.0.1.1255.255.255.0
Router1(config-if)#encapsulationppp 封装ppp协议
Router1(config-if)#pppauthentication chap ppp验证方法chap/pap
Router(config)#hostnamerouter2 为自己建立称
Router2(config)#username router1password cisco 为对方路由器建立名称、密码
Router2(config)#interface serial 0
Router2(config-if)#ip address 10.0.1.2255.255.255.0
Router2(config-if)#encapsulationppp 封装PPP协议
Router2(config-if)#pppauthentication chap ppp验证方法chap/pap
Router1#sh int s0/0 查看protocol is up、 encapsulation ppp、lcp open是否正常
为对方各自建立的密码一样、大小写正确,否则会链路不通
点到点链路,封装类型不同(要相同),链路也不会通;
Router1#sh cdp neighborsdetail 判断ip地址是否正确
Ip地址不正确,显示up,链路畅通,但链路上不能使用ip协议
Router1#debug pppauthentication 查看是否出现与其它行不一样、失败PPP认证
例 PPPoE
配置PPPoe客户端
R1(config)#int f0/0
R1(config-if)#pppoe enable groupglobal 激活PPPoe全球组
R1(config-if)#pppoe-clientdial-pool-number 1 客户端拨号池number 1
配置PPpoe服务器端
Interface Dialer0
Ip address negotiated 地址磋商
Ip mtu 1452
Encapsulation ppp 封装ppp协议
Dialer pool 1 拨号池1
Dealer-group 1 拨号组1
Ppp authentication chapcallin chap召集
Ppp chap hostname todd 名称
Ppp chap password 0 lammle 以上三是建立PPP认证
例帧中继
Router1(config)#int s0
Router1(config-if)#encapsulationframe-relay 封装frame-relay协议
默认cisco,(同类型),IETF(非同类型)
Router1(config-if)#frame-relay interface-dlci16 数据链路连接标识符dlci,pvc永久性
说明:DLCI定义本地路由器和帧中继交换机之间的逻辑电路
Router1(config-if)#frame-relay lmi-typecisco/ansi 本地管理接口类型,默认CISCO
单个接口
Router1(config)#int s0/0
Router1(config-if)#encapsulationframe-relay
Router1(config-if)#ip address 172.16.20.1255.255.255.0
Router1(config-if)#frame-relay lmi-type ansi 本地管理接口ansi 默认cisco类型
Router1(config-if)#frame-relay interface-dlci101
数据链路连接标识符DLCI,指明使用那条PVC由ISP给出
单点子接口
Router1(config)#int s0
Router1(config-if)#int s0.16point-to-point/multipoint 点到点/多点
分配给那个PVC的dlci号
多点:主物理接口不能有IP地址,子接口才有
Intface serial 0
No ip address
No ip directed-broadcast
Encapsulation frame-relay
多点子接口
Interface serial 0.102 point-to-point
Ip address 10.1.12.0255.255.255.0
No ip directed-broadcast
Frame-relay interface-dlci 102
Interface serial 0.103 point-to-point
Ip address 10.1.13.1255.255.255.0
No ip directed-broadcast
Frame-relay interface-dlci 103
验证frame-relay
Router#show frame lmi 查看本地路由器和帧中继交换机的LMI流量统计
Lmi type=cisco 类型
Router#show frame pvc 查看DLCI,pv16相关信息
Router#show interface s0 查看LMI流量、DLCI状态
Router#show frame map 查看网络层到DLCI映射
Router#debug frame-relay lmi 通过lmi信息来排除帧中继连接故障
帧中继网络故障诊断
1. 串行封装问题 两种类型 cisco和ietf
2. 如果帧中继远端网络没有cisco路由器的话,运行
Router(config)#ints0
Router(config-if)#encapsulationframe-relay ietf