1. 程式人生 > >使用GNS3進行子網及路由配置

使用GNS3進行子網及路由配置

拓撲圖

一、基本配置

1.R1路由器的基本配置

  enable
  configure terminal
  interface f0/0
  ip address 192.168.10.1 255.255.255.224
  no shutdown
  interface f1/0
  ip address 202.100.10.1 255.255.255.252
  no shutdown

2.R2路由器的基本配置

  enable
  configure terminal
  interface f0/0
  ip address 202.100.10.2 255.255.255.252
  no shutdown
  interface f1/0
  ip address 202.100.20.1 255.255.255.252
  no shutdown

3.R3路由器的基本配置

  enable
  configure terminal
  interface f0/0
  ip address 192.168.20.1 255.255.255.224
  no shutdown
  interface f1/0
  ip address 202.100.20.2 255.255.255.252
  no shutdown

4.VPCS配置

VPCS1:ip 192.168.10.2/27 192.168.10.1

VPCS2:ip 192.168.20.2/27 192.168.20.1

5.連通性測試(失敗,因為路由器上未新增路由)

VPCS1:ping 192.168.20.2  

VPCS2:ping 192.168.10.2  

二、靜態路由配置(全域性模式下完成)

1、R1靜態路由配置

exit
ip route 0.0.0.0 0.0.0.0 202.100.10.2

2、R2靜態路由配置

exit
ip route 192.168.10.0 255.255.255.224 202.100.10.1
ip route 192.168.20.0 255.255.255.224 202.100.20.2

3、R3靜態路由配置

exit
ip route 0.0.0.0 0.0.0.0 202.100.20.1

4、檢視路由表

1>檢視R1路由器的路由表

R1#show  ip  route(共有3條路由:2條直連路由,1條靜態預設路由)
C 192.168.10.0/27..........(C為直連路由)
C 202.100.10.0/30.............

S* 0.0.0.0/0.................(S*為靜態預設路由)

2>檢視R2路由器的路由表

R2#show  ip  route(共有4條路由:2條直連路由,2條靜態路由)
C 202.100.10.0/30..........(C為直連路由)
C 202.100.20.0/30.............

S 192.168.10/27.................(S為靜態路由)
S 192.168.20/27.................(S為靜態路由)

3>檢視R3路由器的路由表

R3#show  ip  route(共有3條路由:2條直連路由,1條靜態預設路由)
C 192.168.20.0/27..........(C為直連路由)
C 202.100.20.0/30.............

S* 0.0.0.0/0.................(S*為靜態預設路由)

三、連通性測試(成功,所有路由已新增)

VPCS1:ping 192.168.20.2  

VPCS2:ping 192.168.10.2  

四、路由跟蹤測試

VPCS1:trace   192.168.20.2

VPCS2:trace   192.168.10.2