回首页

后一页
前一页
1.6. 从服务器中自动下载路由器配置文件

路由器的配置文件可以存放在tftp,rcp或MOP服务器中,通过一定的设置,路由器在启动后可以自动下载路由器配置文件。路由器需要下载两个文件,也可以下载其中的一个文件,这个文件合在一起成为运行的配置。


  1. 网络共用文件

    该文件包含有几个路由器共同的配置文件。

  2. 私有配置文件

该文件包含有某台路由器特有的配置信息。

这两个文件可用任何纯文本编辑器进入编辑

一般地,要从tftp服务器中下载配置文件的网络拓朴,如图:

Image48.jpg (16252 字节)

下载网络共用文件的配置步骤


  1. 在全局设置模式下,启动路由器配置文件下载功能

    service config

  2. 在全局设置tftp服务器中下载网络共用配置文件

    boot network tftp 网络共用配置文件名 tftp服务器IP地址

  3. 在端口设置状态下,设置端口IP地址

ip address 本地端口IP地址 子网掩码

下载私有配置文件配置步骤


  1. 在全局设置模式下,启动路由器下载配置文件功能

    service config

  2. 在全局设置模式下,设置路由器从tftp服务器中下载私有配置文件

    boot host tftp私有配置文件名 tftp服务器IP地址

  3. 在端口设置状态,设置端口IP地址

ip address 本端口IP地址 子网掩码

实例:

current configuration:

!

version 11.2

service config

no service udp-small-servers

no service tcp-small-servers

!

hostname kim

!

boot host try-host 10.1.1.33

!从地址为10.1.1.33的tftp服务器中下载名为try-host的私有配置文件

boot network try-network 10.1.1.33

!从地址为10.1.1.33的tftp服务器中下载名为try-network的网络共用文件

boot system flash

boot system tftp c2500-j-l-112-9_p.bin 10.1.1.33

boot system rom

!

interface Ethernet0

ip address 10.1.1.33 255.255.255.0

no ip mroute-cache

no ip route-cache

!

interface Serial0

no ip address

no ip mroute-cache

no ip route-cache

!

interface Serial1

no ip address

no ip mroute-cache

no ip route-cache

shutdown

!

no ip classless

!

line con 0

line 1 8

transport input all

line aux 0

transport input all

line vty 0 4

login

!

end

 

 

try-network文件内容

 

ip host kim 10.1.1.1

ip host try 10.1.2.1

ip host try 10.1.3.1

 

chat-sc lab ABORT ERROR ABORT BUSY “” ATDT \T TIMEOUT 60 CONNECT \c

 

try-host文件内容

!

version 11.2

service config

no service udp-small-servers

no service tcp-small-servers

!

hostname kim

!

boot host try-host 10.1.1.33

boot network try-network 10.1.1.33

boot system Flash

boot system c2500-j-l_112-9_p.bin 10.1.1.33

boot system rom

!

interface Ethernet0

ip address 10.1.1.1 255.255.255.0

no ip mroute-cache

no ip route-cache

!

interface Serial0

ip address 10.1.2.1 255.255.255.0

no ip mroute-cache

no ip route-cache

!

interface Serial1

no ip address

no ip mroute-cache

no ip route-cache

shutdown

!

no ip classless

!

line con 0

line 1 8

transport input all

line aux 0

transport input all

line vty 0 4

login

!

end

后一页
前一页

回首页