计算机网络实验

以前的计算机网络实验,各种协议的简单组合。

网络设计要求:

  • 两台交换机S0、S1的fa0/24端口均是通过交叉双绞线相连,形成VLAN中继;

  • R1、R2、R3,设置动态路由RIP;配置2个节点的帧中继环境配置帧中继实现网络互连;

  • 配置静态NAT ,实现地址转换;

  • 设置相关静态路由,使网络连通。

实验设备

  • Cisco2610XM 6台

  • Cisco Catalyst2950-24 Switch 4台

  • 帧中继交换机1台

  • 带网卡及装有超级终端的计算机8台

  • 服务器2台

  • DCE/DTE线7条,交叉双绞线2条,直通双绞线12条

实验拓扑图

实验拓扑图

网络设备地址列表

设备名称 网络地址
R1 Fa0/0 210.40.1.1/24
S0/0 210.10.1.1/24
S0/1 210.10.2.1/24 S0/2 218.10.1.1/24
R2 S0/0 210.10.1.2/24
S0/1 210.10.2.1/24
S0/2 210.20.1.1/24
R3 S0/0 210.10.2.2/24
S0/1 210.10.3.2/24
S0/2 210.30.1.1/24
R4 Fa0/0 210.50.1.1/24
S0/0 218.10.1.2/24
R5 Fa0/0 210.20.2.1/24
S0/0 210.20.1.2/24
R6 Fa0/0 192.168.1.1/24
S0/0 210.30.1.2/24
PC0 192.168.1.11/24
PC1 192.168.1.12/24
PC2 192.168.1.13/24
PC3 210.20.2.11/24
PC4 210.40.1.11/24
PC5 210.40.1.21/24
PC6 210.40.1.12/24
PC7 210.40.1.12/24
Server0 210.50.1.11/24
Server1 192.168.1.2/24

配置过程

  • 配置VLAN

  • 配置路由器R1的各端口IP,并配置动态路由RIP协议

  • 配置路由器R2的各端口IP,并配置动态路由RIP协议

  • 配置路由器R3的各端口IP,并配置动态路由RIP协议

  • 配置路由器R4、5、6的各端口IP,并配置静态路由

  • 配置帧中继

  • 配置静态NAT映射关系

网络设备配置

VLAN配置

S0:

  1. hostname S0>
  2. interface FastEthernet0/1
  3. switchport access vlan 10
  4. interface FastEthernet0/10
  5. switchport access vlan 20
  6. interface FastEthernet0/23
  7. interface FastEthernet0/24
  8. switchport mode trunk
  9. interface Vlan1
  10. no ip address
  11. line con 0
  12. line vty 0 4
  13. login
  14. line vty 5 15
  15. login

S1:

  1. hostname S1
  2. interface FastEthernet0/1
  3. switchport access vlan 10
  4. switchport mode access
  5. interface FastEthernet0/2
  6. switchport access vlan 10
  7. switchport mode access
  8. !interface FastEthernet0/10
  9. switchport access vlan 20
  10. interface FastEthernet0/11
  11. switchport access vlan 20
  12. interface FastEthernet0/23
  13. interface FastEthernet0/24
  14. switchport mode trunk
  15. interface Vlan1
  16. no ip address
  17. shutdown
  18. line con 0
  19. line vty 0 4
  20. login
  21. line vty 5 15
  22. login

RIP动态路由,帧中继,静态路由配置

R1:

  1. hostname R1
  2. interface FastEthernet0/0
  3. ip address 210.40.1.1 255.255.255.0
  4. duplex auto
  5. speed auto
  6. interface Serial0/0
  7. bandwidth 500
  8. ip address 210.10.1.1 255.255.255.0
  9. clock rate 64000
  10. interface Serial0/1
  11. bandwidth 500
  12. ip address 210.10.2.1 255.255.255.0
  13. clock rate 64000
  14. interface Serial0/2
  15. ip address 218.10.1.1 255.255.255.0
  16. encapsulation frame-relay
  17. frame-relay map ip 218.10.1.1 201 cisco
  18. clock rate 64000
  19. router rip
  20. network 210.10.1.0
  21. network 210.10.2.0
  22. network 210.10.3.0
  23. network 210.40.1.0
  24. no auto-summary
  25. ip classless
  26. ip route 210.20.2.0 255.255.255.0 210.20.1.1
  27. ip route 210.50.1.0 255.255.255.0 218.10.1.2
  28. no cdp run
  29. line con 0
  30. line vty 0 4
  31. login

R2:

  1. hostname R2
  2. interface FastEthernet0/0
  3. no ip address
  4. duplex auto
  5. speed auto
  6. shutdown
  7. interface Serial0/0
  8. bandwidth 500
  9. ip address 210.10.1.2 255.255.255.0
  10. interface Serial0/1
  11. bandwidth 500
  12. ip address 210.10.3.1 255.255.255.0
  13. interface Serial0/2
  14. ip address 210.20.1.1 255.255.255.0
  15. router rip
  16. network 210.10.1.0
  17. network 210.10.3.0
  18. network 210.20.1.0
  19. ip classless
  20. ip route 210.20.2.0 255.255.255.0 210.20.1.2
  21. ip route 210.50.1.0 255.255.255.0 210.10.1.1
  22. line con 0
  23. line vty 0 4
  24. login

R3:

  1. hostname R3
  2. interface Loopback0
  3. no ip address
  4. interface FastEthernet0/0
  5. no ip address
  6. duplex auto
  7. speed auto
  8. shutdown
  9. interface Serial0/0
  10. bandwidth 500
  11. ip address 210.10.2.2 255.255.255.0
  12. interface Serial0/1
  13. bandwidth 500
  14. ip address 210.10.3.2 255.255.255.0
  15. clock rate 64000
  16. interface Serial0/2
  17. bandwidth 500
  18. ip address 210.30.1.1 255.255.255.0
  19. clock rate 64000
  20. router rip
  21. network 210.10.2.0
  22. network 210.10.3.0
  23. network 210.30.1.0
  24. ip classless
  25. ip route 210.20.2.0 255.255.255.0 210.20.1.1
  26. ip route 210.50.1.0 255.255.255.0 210.10.2.1
  27. line con 0
  28. line vty 0 4
  29. login

R4

  1. hostname R4
  2. interface FastEthernet0/0
  3. ip address 210.50.1.1 255.255.255.0
  4. duplex auto
  5. speed auto
  6. interface Serial0/0
  7. ip address 218.10.1.2 255.255.255.0
  8. encapsulation frame-relay
  9. frame-relay map ip 218.10.1.2 102 cisco
  10. clock rate 64000
  11. interface Serial0/1
  12. no ip address
  13. shutdown
  14. router rip
  15. ip classless
  16. ip route 0.0.0.0 0.0.0.0 218.10.1.1
  17. no cdp run
  18. line con 0
  19. line vty 0 4
  20. login

R5:

  1. hostname R5
  2. interface FastEthernet0/0
  3. ip address 210.20.2.1 255.255.255.0
  4. duplex auto
  5. speed auto
  6. interface Serial0/0
  7. ip address 210.20.1.2 255.255.255.0
  8. clock rate 64000
  9. interface Serial0/1
  10. no ip address
  11. shutdown
  12. router rip
  13. ip classless
  14. ip route 0.0.0.0 0.0.0.0 210.20.1.1
  15. no cdp run
  16. line con 0
  17. line vty 0 4
  18. login

配置静态NAT

R6:

  1. hostname R6
  2. interface FastEthernet0/0
  3. ip address 192.168.1.1 255.255.255.0
  4. ip nat inside
  5. duplex auto
  6. speed auto
  7. interface Serial0/0
  8. ip address 210.30.1.2 255.255.255.0
  9. ip nat outside
  10. interface Serial0/1
  11. no ip address
  12. shutdown
  13. ip nat inside source static 192.168.1.11 210.30.1.11
  14. ip nat inside source static 192.168.1.12 210.30.1.12
  15. ip nat inside source static 192.168.1.13 210.30.1.13
  16. ip classless
  17. ip route 210.20.2.0 255.255.255.0 210.30.1.1
  18. ip route 0.0.0.0 0.0.0.0 210.30.1.1
  19. line con 0
  20. line vty 0 4
  21. login

结果测试

实验结果

实验结果

实验结果

PC0、PC3、SERVER0均可两两ping通,帧中继,RIP,静态NAT配置成功

实验结果

实验结果

对VLAN10、VLAN20进行测试,连通,VLAN配置成功

tcp2 计算机网络4