如图所示,用交换机和路由器连接4台PC机,代表4个网络,实现相互通信。

如图:利用eNsp软件创建一个项目,建立如图所示的网络拓扑。交换机用S3700,路由器用Router, 各端口连接关系如图所示。

这里需要注意用Copper建立GE口:

1.在路由器R3的命令行中,用sysname命令,将路由器名称改为:R+学号, 如:学号为12345678的同学,将其名称改为:R12345678

2. 按图中VLAN、端口以及IP地址的规定,规划和配置将交换机和用户终端。将Switch1上创建vlan30 和vlan40,将ethernet 0/0/1号端口设置为access类型端口,划分到vlan30, 将ethernet 0/0/2号端口设置为access类型端口,划分到vlan40, 将GigabitEthernet 0/0/1设置为trunk类型端口,并允许vlan30和vlan40通过。

  • 进入交换机

  • 配置vlan

    • system-view

      vlan 30

      vlan 40

  • 配置端口

    • interface Ethernet 0/0/1

      port link-type access

      port default vlan 30

      quit

      interface Ethernet 0/0/2

      port link-type access

      port default vlan 40

      quit

      interface GigabitEthernet 0/0/1

      port link-type trunk

      port trunk allow-pass vlan 30 40

      quit

  • 过程截图:

3. 设置路由器R3的G0/0/2号端口的两个子接口,G0/0/2.1加入到VLAN 30,G0/0/2.2加入到VLAN 40。   

  • 启动R3配置子接口

    • interface GigabitEthernet 0/0/2.1

      dot1q termination vid 30

      ip address 192.168.30.254 255.255.255.0

      quit

      interface GigabitEthernet 0/0/2.2

      dot1q termination vid 40

      ip address 192.168.40.254 255.255.255.0

      quit

  • 过程截图

4.路由器其它接口的地址,按照需要自行配置。

  • interface GigabitEthernet 0/0/0

  • ip address 192.168.10.254 255.255.255.0

  • quit

  • interface GigabitEthernet 0/0/1

  • ip address 192.168.20.254 255.255.255.0

  • quit

  • 检查配置信息:

5.在路由器上配置路由信息,可使用静态配置方式,也可以使用动态路由协议RIP或OSPF,配置完成后,使得4台PC机可以互相连通。   

  • R1:

    • interface Ethernet 0/0/0

    • ip address 192.168.10.254 255.255.255.0

    • quit

    • interface GigabitEthernet 0/0/0

    • ip address 192.168.10.1 255.255.255.0

    • quit

    • ip route-static 192.168.20.0 255.255.255.0 192.168.10.1

    • ip route-static 192.168.30.0 255.255.255.0 192.168.10.1

    • ip route-static 192.168.40.0 255.255.255.0 192.168.10.1

    • quit

    • save

  • R2:

    • interface Ethernet 0/0/0

    • ip address 192.168.20.254 255.255.255.0

    • quit

    • interface GigabitEthernet 0/0/0

    • ip address 192.168.20.1 255.255.255.0

    • quit

    • ip route-static 192.168.10.0 255.255.255.0 192.168.20.1

    • ip route-static 192.168.30.0 255.255.255.0 192.168.20.1

    • ip route-static 192.168.40.0 255.255.255.0 192.168.20.1

    • quit

    • save

6.在各个交换机和路由器上,切换到用户视图下,执行save命令,保存实验配置。

7.在路由器3上运行:display current-configuration、以及display ip routing-table命令,将显示的结果的若干页截屏,连同步骤1到步骤5的操作过程截图,粘贴到一个WORD文件中,保存为“实验报告+学号”。

8.在ENSP软件的文件菜单中,选择文件->另存为,将项目保存为:work+学号。

9.找到ENSP保存的项目目录,即名为work+学号的目录,将实验报告WORD文件存放到该目录中。

10.将该目录压缩到一个名为work+学号的压缩文件中,然后提交该压缩文件。