2010年9月15日星期三

静态路由的配置

西安交通大学实验报告

课程:网络技术实验
完成时间:2010年5月13日
实验名称:静态路由的配置

实验内容

    使用Boson NetSim软件模拟出路由器的环境,并配置静态路由。

    使用Boson NetSim Designer软件设计一个含有三个路由器和两个PC机的网络环境,两个PC机器分别连接到两个路由器(1750)上,这两个1750型路由器连接到同一个2611型路由器上(使用串口)。如图:


    在PC1上使用ipconfig指令配置IP:
C:>ipconfig /ip 192.168.0.2 255.255.255.0
C:>ipconfig /dg 192.168.0.1
C:>ipconfig
  Boson BOSS 5.0 IP Configuration
     Ethernet adapter Local Area Connection:
        IP Address. . . . . . . . . . . . : 192.168.0.2
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.0.1
    在PC2上使用winipcfg进行类似配置:


    分别配置三个路由器的IP地址(#后为注释,下同):
# Router1:
Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface e0
Router(config-if)#ip address 192.168.0.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router(config-if)#exit
Router(config)#interface s0
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
Router(config-if)#exit

# Router2:

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface e0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router(config-if)#exit
Router(config)#interface s0
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
Router(config-if)#exit

# Router3:
Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface s0
Router(config-if)#ip address 192.168.2.3 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
Router(config-if)#exit
Router(config)#interface s1
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
Router(config-if)#ip address 192.168.3.3 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial1, changed state to up
Router(config-if)#exit
Router(config)#exit
%LINK-3-UPDOWN: Interface Serial1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down
    使用show controllers指令查看各个路由是DCE还是DTE:
# Router3:
Router#show controllers

HD unit 0, idb = 0x1AE828, driver structure at 0x1B4BA0
buffer size 1524  HD unit 0,V.35 DCE cable
cpb = 0x7, eda = 0x58DC, cda = 0x58F0
RX ring with 16 entries at 0x4075800

HD unit 0, idb = 0x1AE828, driver structure at 0x1B4BA0
buffer size 1524  HD unit 0,V.35 DCE cable
cpb = 0x7, eda = 0x58DC, cda = 0x58F0
RX ring with 16 entries at 0x4075800
……

# Router1:
Router#show controllers

HD unit 0, idb = 0x1AE828, driver structure at 0x1B4BA0
buffer size 1524  HD unit 0,V.35 DTE cable
cpb = 0x7, eda = 0x58DC, cda = 0x58F0
RX ring with 16 entries at 0x4075800

# Router 2:
Router>show controllers

HD unit 0, idb = 0x1AE828, driver structure at 0x1B4BA0
buffer size 1524  HD unit 0,V.35 DTE cable
cpb = 0x7, eda = 0x58DC, cda = 0x58F0
RX ring with 16 entries at 0x4075800
    在Router3上配置时钟频率:
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface s0
Router(config-if)#clock rate 64000
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
Router(config-if)#exit
Router(config)#interface s1
Router(config-if)#clock rate 64000
Router(config-if)#exit
%LINK-3-UPDOWN: Interface Serial1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up
    在3个路由器上分别配置转发规则:
# Router1
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.3
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.3

# Router2
Router(config)#ip route 192.168.0.0 255.255.255.0 192.168.3.3
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.3

# Router3
Router(config)#ip route 192.168.0.0 255.255.255.0 192.168.2.1
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.2
    检查配置,在PC1上尝试traceroute到PC2:
C:>tracert 192.168.1.2

Tracing the route to 192.168.1.2

 1 192.168.0.1 0 msec 16 msec 0 msec
 2 192.168.2.3 20 msec 16 msec 16 msec
 3 192.168.3.2 20 msec 16 msec 16 msec
 4 192.168.1.2 20 msec 16 msec *
(完)

笔记:


Router1, Router2: 1750
Serial / Ethernet

Router3: 2611
2 Serials

# PC1
ipconfig /ip 192.20.10.87 255.255.255.0
ipconfig /dg 192.20.10.1 # 配置网关

# PC2
winipcfg # 出现GUI界面
# 192.168.0.87 255.255.255.0 192.168.0.1

# Router1
enable
conf t
interface e0
ip address 192.20.10.1 255.255.255.0
no shutdown
exit
interface s0
ip address 192.200.10.1 255.255.255.0
no shutdown
exit

# Router2
enable
conf t
interface e0
ip address 192.168.0.1 255.255.255.0
no shutdown
exit
interface s0
ip address 192.16.10.1 255.255.255.0
no shutdown
exit


# Router3
enable
conf t
interface s0
ip address 192.200.10.2 255.255.255.0
no shutdown
exit
interface s1
ip address 192.16.10.2 255.255.255.0
no shutdown
exit

show controllers # 检查是DCE还是DTE(DTE)

# Router1
show controllers

conf t
interface s0
clock rate 64000

# Router2
show controllers
conf t
interface s0
clock rate 64000

# 开始配置路由协议(config提示符下)
# Router1
ip route 192.16.10.0 255.255.255.0 192.200.10.2 # 配置下一跳的地址
ip route 192.168.0.0 255.255.255.0 192.200.10.2

# Router2
ip route 192.200.10.0 255.255.255.0 192.16.10.2
ip route 192.20.10.0 255.255.255.0 192.16.10.2

# Router3
ip route 192.168.0.0 255.255.255.0 192.16.10.1
ip route 192.20.10.0 255.255.255.0 192.200.10.1

# 验证路由配置成功
# PC1
ping 192.168.0.87


没有评论:

发表评论