1 / 30

任务 4

任务 4. 路由器配置基础. 任务分解:. 路由器的工作原理 路由器的命令模式 路由器的基本配置 配置路由器的端口. 路由器的配置途径与初始配置. 路由器的配置途径 路由器的配置途径与交换机相同,首次配置也必须通过 Console 口进行配置,在设置了路由器的 IP 地址后,也可通过 Telnet 登录的方式,来实现远程配置和管理。. 路由器的配置途径与初始配置. 规划路由器的配置参数. 1. 设置路由器端口的 IP 地址及子网掩码。

donagh
Télécharger la présentation

任务 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 任务4 路由器配置基础

  2. 任务分解: • 路由器的工作原理 • 路由器的命令模式 • 路由器的基本配置 • 配置路由器的端口

  3. 路由器的配置途径与初始配置 • 路由器的配置途径 • 路由器的配置途径与交换机相同,首次配置也必须通过Console口进行配置,在设置了路由器的IP地址后,也可通过Telnet登录的方式,来实现远程配置和管理。

  4. 路由器的配置途径与初始配置 • 规划路由器的配置参数 1. 设置路由器端口的IP地址及子网掩码。 2. A类IP地址属于可在局域网内部使用的私有IP地址,为使内部网络可以访问Internet,路由器必须做NAT转换。 3. 配置虚拟终端,以进行远程登录和管理。 4. 配置ACL。 5. 配置默认路由。

  5. 路由器的配置途径与初始配置 • 路由器的启动过程 • (1)系统自举 • (2)启动加载 • (3)启动系统IOS镜像文件 • (4)接口初始化/系统重新启动

  6. 路由器的配置途径与初始配置 • 路由器的初始配置 • 1.设置路由器名 • 2.设置进入特权模式的密文 • 3.设置进入特权模式的密码 • 4.设置虚拟终端访问的密码 • 5.询问是否要设置路由器支持的各种网络协议 • 6.配置接口 • 7.系统提问是否使用以上设置 • 8. NAT配置 • 9. ACL配置 • 10.默认路由配置

  7. 路由器常规配置 • 配置主机名 • router>enable • router#configure terminal • router(config)#hostname router2621

  8. 路由器常规配置 • 设置特权密码、vty和console端口 • 1.设置特权密码 • 配置命令:enable password passowrd • enable secret password

  9. 路由器常规配置 • 设置特权密码、vty和console端口 • 2.vty端口 • 配置命令为: • router> enable • router# configure terminal • router(config)# line vty 0 4 • router(config-line)# password router • router(config-line)# login • router(config-line)# exec-timeout 1 0 • router(config-line)#access-class access-list [in | out]

  10. 路由器常规配置 • 设置特权密码、vty和console端口 • 3.配置Console端口 • 配置命令为: • router> enable • router# configure terminal • router(config)# line console 0 • router(config-line)# password router • router(config-line)# login • router(config-line)# exec-timeout 1 0

  11. 路由器常规配置 • 启用与禁用DNS • 1.启用DNS • ip domain-lookup • 2.禁用DNS • no ip domain-lookup • 3.设置路由器的DNS服务器地址 • ip name-server [address] • 4.设置主机的域名 • ip domain-name host • 5.设置域名与IP地址的映射表 • ip host domain_name ip_ address

  12. 配置路由器的端口 • 1.选择端口 • 配置命令:interface typemod/port • 2.设置对端口的描述 • 配置命令:router(config-if)#description word • 3.配置通讯方式 • 配置命令:router(config-if)#duplex { auto | full | half } • 4.配置端口速度 • 配置命令:router(config-if)#speed { 10 | 100 | auto } • 5.配置端口带宽 • 配置命令:router(config-if)#bandwidth kilobits

  13. 配置路由器的端口 • 6.配置MTU • 配置命令:router(config-if)#mtu mtu_size • 7.配置封装协议 • 配置命令: • router(config-if)#encapsulation {frame-relay | hdlc | ppp} • 8.配置端口的线路速率 • Router(config-if)# clock rate { 9600 | 14400 | 19200 | 28800 | 32000 | 38400 | 56000 | 57600 | 64000 | 72000 | 115200 | 125000 | 128000 | 148000 | 500000 | 800000 | 1000000 | 1300000 | 2000000 | 4000000 | 8000000 }

  14. 配置路由器的端口 • 9.配置端口IP地址 • 配置命令: • router(config-if)#ip address ip_addresssubnet_mask [ secondary ] • 10.为端口应用访问列表 • 配置命令: • router(config-if)#ip access-group access_list {in | out} • 11.启用与禁用端口 • 启用端口,配置命令:router(config-if)# shutdown • 禁用端口,配置命令:router(config-if)#no shutdown

  15. 路由器启动时的输出内容 --- System Configuration Dialog --- Continue with configuration dialog? [yes/no]:yes At any point you may enter a question mark '?' for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets '[ ]'. Router con0 is now available Press RETURN to get started. Setup模式 Router> 命令行模式

  16. 路由器的配置模式 • 用户模式:Router> • 特权模式:Router# • 全局配置模式:Router(config)# • 接口配置模式:Router(config-if)# • 子接口配置模式: Router(config)#interface fa0/0.1 • Router(config-subif)# • Line模式:Router(config-line)# • 路由模式:Router(config-router)#

  17. 静态路由的配置举例2-1 • 如果路由器A连接的网络需要访问192.168.1.0网段的主机,需要做什么设置? 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 Network A B B 192.168.2.2 192.168.2.1 192.168.1.11

  18. 静态路由的配置举例2-2 • Router A>enable • Router A#config terminal • Router A(config) #interface f0/0 • Router A(config-if) #ip address 192.168.2.2 255.255.255.0 • Router A(config-if)#no shutdown • Router A(config-if)#exit • Router A(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 配置接口IP地址 目标网段的掩码 下一跳地址 目标网段 激活端口 配置静态路由

  19. 默认路由的配置举例2-1 • 192.168.1.0网段的主机需要访问外部的网络,B路由器是这个网段唯一的出口,可以在B路由器上配置默认路由。 192.168.1.0 fa0/1 fa0/0 fa0/0 Network A B B 192.168.2.2 192.168.2.1

  20. 默认路由的配置举例2-2 • Router B>enable • Router B#config terminal • Router B(config) #interface f0/1 • Router B(config-if) #ip address 192.168.2.1 255.255.255.0 • Router B(config-if)#no shutdown • Router B(config-if)#exit • Router B(config) #interface f0/0 • Router B(config-if) #ip address 192.168.1.1 255.255.255.0 • Router B(config-if)#no shutdown • Router B(config-if)#exit • Router B(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2 下一跳地址 表示任何网络

  21. 查看路由器配置 Router A#show running-config ! interface Loopback0 no ip address ! interface FastEthernet0/0 ip address 192.168.2.2 255.255.255.0 duplex auto speed auto ! ip classless ip route 192.168.1.0 255.255.255.0 192.168.2.1 no ip http server ! line con 0 line aux 0 line vty 0 4 已配置的IP地址 已配置的静态路由

  22. 查看路由表 RouterA#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set S 192.168.1.0/24 [1/0] via 192.168.2.1 C 192.168.2.0/24 is directly connected, FastEthernet0/0 S表示静态路由 C表示直连路由

  23. 检查配置是否正确2-1 • 在路由器A上,使用ping命令检查与192.168.1.0网段的主机是否连通: • Router A# ping 192.168.1.10 • 如果ping通,此时在路由器A上显示: • Type escape sequence to abort. • Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds: • ! ! ! ! ! • Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms • 如果不通,在路由器A上会显示: • Type escape sequence to abort. • Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds: • . . . . . • Success rate is 0 percent (0/5)

  24. 检查配置是否正确2-1 • 如果不通,可能是: • 连接线缆的问题 • 接口还是shutdown的状态 • IP地址配置的问题 • 静态路由配置不正确 • …… • 检查方法: 分段检查:定位故障的位置

  25. A不能ping通主机192.168.1.10 是否能ping通B的f0/1口 是否能ping通B的f0/0口 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 A B B 192.168.2.2 192.168.2.1 问题不在A上 192.168.1.11 分段检查4-1 是:说明故障不在A与B的连接部分 是

  26. A不能ping通主机192.168.1.10 是否能ping通B的f0/1口 是否能ping通B的f0/0口 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 A B B 192.168.2.2 192.168.2.1 问题不在A上 192.168.1.11 分段检查4-2 是:说明故障不在A与B的连接部分 是

  27. A不能ping通主机192.168.1.10 是否能ping通B的f0/1口 A的f0/0口是否up 是 IP地址是否配置正确 修改IP地址 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 是 A B B 192.168.2.2 192.168.2.1 问题不在A上 192.168.1.11 分段检查4-3 否 否

  28. A不能ping通主机192.168.1.10 1 2 administrative down line protocol is down 是否能ping通B的f0/1口 A的f0/0口是否up 检查线缆 激活端口 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 A B B 192.168.2.2 192.168.2.1 问题不在A上 192.168.1.11 分段检查4-4 否 否 否 或

  29. A不能ping通主机192.168.1.10 是否能ping通B的f0/1口 是否能ping通B的f0/0口 路由是否配置正确 192.168.1.0 fa0/0 fa0/0 fa0/1 192.168.1.10 A B B 192.168.2.2 192.168.2.1 修改路由配置 问题不在A上 192.168.1.11 分段检查4-5 是:说明故障不在A与B的连接部分 否 是 否

  30. 阶段总结 • 路由器的硬件组成与启动过程 • 静态路由的配置 • 默认路由的配置 • 验证与排错

More Related