找回密码
 立即注册
搜索
查看: 56|回复: 1

期末实操考试试卷(22级)(A卷)

[复制链接]

9

主题

4

回帖

105

积分

管理员

积分
105
发表于 2023-6-14 21:32:18 | 显示全部楼层 |阅读模式 来自 广东深圳
拓扑图:





网络拓扑如图所示,网络由私网和公网构成,私网包括总部LAN和分公司LAN,请按以下要求完成配置。

1、按拓扑图标示要求设置各路由器主机名,特别地,总部交换机XYZ的主机名以自己姓名拼音第一字母命名,如刘德华即LDH(5分)

参考以下步骤,按照拓扑图标识分别配置各路由器各交换机以及总部交换机的主机名。
命令格式:hostname 主机名

  1. 路由器:
  2. Router>en
  3. Router#conf t
  4. Enter configuration commands, one per line.  End with CNTL/Z.
  5. Router(config)#hostname R0
  6. R0(config)#

  7. 交换机:
  8. Switch>en
  9. Switch#conf t
  10. Enter configuration commands, one per line.  End with CNTL/Z.
  11. Switch(config)#hostname Sw1
  12. Sw1(config)#

  13. 总部交换机:
  14. Switch>en
  15. Switch#conf t
  16. Enter configuration commands, one per line.  End with CNTL/Z.
  17. Switch(config)#hostname ZS
  18. ZS(config)#
复制代码

2、图中已给出各网段的网络号及掩码,请据此静态配置路由器各接口IP及所有PC或服务器IP(分公司LAN的PC的IP地址除外)(5分)

配置R0:
  1. R0>en
  2. R0#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R0(config)#int f0/0
  5. R0(config-if)#ip add 192.168.1.9 255.255.255.252
  6. R0(config-if)#no sh

  7. R0(config-if)#
  8. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

  9. R0(config-if)#int f0/1
  10. R0(config-if)#ip add 192.168.1.1 255.255.255.252
  11. R0(config-if)#no sh

  12. R0(config-if)#
  13. %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

  14. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

  15. R0(config-if)#int s0/0
  16. R0(config-if)#ip add 1.1.1.1 255.255.255.252
  17. R0(config-if)#no sh

  18. %LINK-5-CHANGED: Interface Serial0/0, changed state to down
  19. R0(config-if)#
复制代码

配置R1:
  1. R1>en
  2. R1#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R1(config)#int f0/0
  5. R1(config-if)#ip add 192.168.1.5 255.255.255.252
  6. R1(config-if)#no sh

  7. R1(config-if)#
  8. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

  9. R1(config-if)#int f0/1
  10. R1(config-if)#ip add 192.168.1.2 255.255.255.252
  11. R1(config-if)#no sh

  12. R1(config-if)#
  13. %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

  14. R1(config-if)#int f1/0
  15. R1(config-if)#no sh

  16. R1(config-if)#
  17. %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

  18. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

  19. R1(config-if)#
复制代码

配置R2:
  1. R2>en
  2. R2#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R2(config)#int f0/0
  5. R2(config-if)#ip add 192.168.1.10 255.255.255.252
  6. R2(config-if)#no sh

  7. R2(config-if)#
  8. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

  9. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

  10. R2(config-if)#int f0/1
  11. R2(config-if)#ip add 192.168.1.6 255.255.255.252
  12. R2(config-if)#no sh

  13. R2(config-if)#
  14. %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

  15. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

  16. R2(config-if)#int s0/0
  17. R2(config-if)#ip add 172.16.1.1 255.255.255.252
  18. R2(config-if)#no sh

  19. %LINK-5-CHANGED: Interface Serial0/0, changed state to down
  20. R2(config-if)#
复制代码

配置R3:
  1. R3>en
  2. R3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R3(config)#int f0/0
  5. R3(config-if)#no sh

  6. R3(config-if)#
  7. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

  8. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

  9. R3(config-if)#int s0/0
  10. R3(config-if)#ip add 172.16.1.2 255.255.255.252
  11. R3(config-if)#no sh

  12. R3(config-if)#
  13. %LINK-5-CHANGED: Interface Serial0/0, changed state to up

  14. R3(config-if)#
复制代码

配置R4:
  1. R4>en
  2. R4#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R4(config)#int f0/0
  5. R4(config-if)#ip add 11.1.1.254 255.255.255.0
  6. R4(config-if)#no sh

  7. R4(config-if)#
  8. %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

  9. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

  10. R4(config-if)#int s0/0
  11. R4(config-if)#ip add 1.1.1.2 255.255.255.252
  12. R4(config-if)#no sh

  13. R4(config-if)#
  14. %LINK-5-CHANGED: Interface Serial0/0, changed state to up

  15. R4(config-if)#
复制代码

PC0配置:


PC1配置:


S0配置:



S1配置:



PC6配置:




S3配置:


3、在路由器R3上配置DHCP server,使得分公司LAN的PC的IP地址由DHCP server动态分配(10分)

命令格式:
排除地址:
ip dhcp excluded-address 需要排除的IP地址
创建一个地址池。

ip dhcp pool 地址池名称
以下为地址池参数命令:
设置地址池范围及网关。
network 子网地址(网段) 子网掩码
default-router 默认网关

配置R3:
  1. R3(config)#ip dhcp pool VLAN10
  2. R3(dhcp-config)#network 10.2.1.0 255.255.255.0
  3. R3(dhcp-config)#default-router 10.2.1.254
  4. R3(dhcp-config)#exit
  5. R3(config)#ip dhcp pool VLAN20
  6. R3(dhcp-config)#network 10.2.2.0 255.255.255.0
  7. R3(dhcp-config)#default-router 10.2.2.254
  8. R3(dhcp-config)#exit
  9. R3(config)#ip dhcp excluded-address 10.2.1.254
  10. R3(config)#ip dhcp excluded-address 10.2.2.254
复制代码


4、总部LAN划分成两个VLAN(VLAN10、VLAN20),完成相关配置使得VLAN之间互通(10分)


命令格式:
创建VLAN。
vlan VLAN编号
设置接口模式。

switchport mode 接口模式(access|trunk|dynamic
接口划分VLAN。
switchport access vlan VLAN编号

配置Sw1:
  1. Sw1>en
  2. Sw1#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Sw1(config)#vlan 10
  5. Sw1(config-vlan)#exit
  6. Sw1(config)#int range f0/1-2
  7. Sw1(config-if-range)#switchport mode access
  8. Sw1(config-if-range)#switchport access vlan 10
  9. Sw1(config-if-range)#exit
  10. Sw1(config)#
复制代码


配置Sw2:
  1. Sw2>en
  2. Sw2#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Sw2(config)#vlan 20
  5. Sw2(config-vlan)#exit
  6. Sw2(config)#int range f0/1-2
  7. Sw2(config-if-range)#switchport mode access
  8. Sw2(config-if-range)#switchport access vlan 20
  9. Sw2(config-if-range)#exit
  10. Sw2(config)#
复制代码


配置总部交换机XYZ:
  1. ZS>en
  2. ZS#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. ZS(config)#vlan 10
  5. ZS(config-vlan)#vlan 20
  6. ZS(config-vlan)#exit
  7. ZS(config)#int f0/24
  8. ZS(config-if)#switchport mode trunk

  9. ZS(config-if)#
  10. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down

  11. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up

  12. ZS(config-if)#
复制代码

配置R1:
命令格式:
允许VLAN数据通过。
encapsulation dot1Q VLAN编号

  1. R1>en
  2. R1#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R1(config)#int f1/0.10
  5. R1(config-subif)#
  6. %LINK-5-CHANGED: Interface FastEthernet1/0.10, changed state to up

  7. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0.10, changed state to up

  8. R1(config-subif)#encapsulation dot1Q 10
  9. R1(config-subif)#ip add 10.1.1.254 255.255.255.0
  10. R1(config-subif)#no sh
  11. R1(config-subif)#int f1/0.20
  12. R1(config-subif)#
  13. %LINK-5-CHANGED: Interface FastEthernet1/0.20, changed state to up

  14. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0.20, changed state to up

  15. R1(config-subif)#encapsulation dot1Q 20
  16. R1(config-subif)#ip add 10.1.2.254 255.255.255.0
  17. R1(config-subif)#no sh
  18. R1(config-subif)#exit
  19. R1(config)#
复制代码

验证PC0与S0、S1的连通性。


5、两个分公司LAN分别划分两个VLAN(VLAN10、VLAN20),完成相关配置,使得VLAN之间互通(10分)

配置Sw3:
  1. Sw3>en
  2. Sw3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Sw3(config)#vlan 10
  5. Sw3(config-vlan)#vlan 20
  6. Sw3(config-vlan)#exit
  7. Sw3(config)#int f0/1
  8. Sw3(config-if)#switchport mode access
  9. Sw3(config-if)#switchport access vlan 10
  10. Sw3(config-if)#int f0/2
  11. Sw3(config-if)#switchport mode access
  12. Sw3(config-if)#sw access vlan 20
  13. Sw3(config-if)#int ran f0/23-24
  14. Sw3(config-if-range)#switchport mode trunk
  15. Sw3(config-if-range)#exit
  16. Sw3(config)#
复制代码


配置Switch0:
  1. Switch0>en
  2. Switch0#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Switch0(config)#vlan 10
  5. Switch0(config-vlan)#vlan 20
  6. Switch0(config-vlan)#exit
  7. Switch0(config)#int f0/1
  8. Switch0(config-if)#switchport mode access
  9. Switch0(config-if)#switchport access vlan 20
  10. Switch0(config-if)#int f0/2
  11. Switch0(config-if)#switchport mode access
  12. Switch0(config-if)#switchport access vlan 10
  13. Switch0(config-if)#int f0/24
  14. Switch0(config-if)#switchport mode trunk
  15. Switch0(config-if)#exit
  16. Switch0(config)#
复制代码


配置R3:
  1. R3>en
  2. R3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R3(config)#int f0/0.10
  5. R3(config-subif)#
  6. %LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

  7. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

  8. R3(config-subif)#encapsulation dot1Q 10
  9. R3(config-subif)#ip add 10.2.1.254 255.255.255.0
  10. R3(config-subif)#no sh
  11. R3(config-subif)#int f0/0.20
  12. R3(config-subif)#
  13. %LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up

  14. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up

  15. R3(config-subif)#encapsulation dot1Q 20
  16. R3(config-subif)#ip add 10.2.2.254 255.255.255.0
  17. R3(config-subif)#no sh
  18. R3(config-subif)#exit
  19. R3(config)#
复制代码

设置PC2、PC3、PC4、PC5为DHCP模式,成功获取IP地址。





测试子公司VLAN10与VLAN20的连通性:


6、在私网内配置OSPF协议,公网配置RIPv2协议,私网边界路由器R0下发默认路由到私网路由器(要求除边界路由器R0外,私网路由不能发布到公网路由器,公网路由不能发布到私网路由器)(20分)


配置R0:
  1. R0>en
  2. R0#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R0(config)#router ospf 1
  5. R0(config-router)#router-id 1.1.1.1
  6. R0(config-router)#network 192.168.1.8 0.0.0.3 area 0
  7. R0(config-router)#network 192.168.1.0 0.0.0.3 area 0
  8. R0(config-router)#default-information originate
  9. R0(config-router)#exit
  10. R0(config)#ip route 0.0.0.0 0.0.0.0 s0/0
  11. R0(config)#
复制代码

配置R1:
  1. R1>en
  2. R1#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R1(config)#router ospf 1
  5. R1(config-router)#router-id 2.2.2.2
  6. R1(config-router)#network 192.168.1.4 0.0.0.3 area 0
  7. R1(config-router)#network 192.168.1.0 0.0.0.3 area 0
  8. R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
  9. R1(config-router)#network 10.1.2.0 0.0.0.255 area 0
  10. R1(config-router)#exit
  11. R1(config)#
复制代码

配置R2:
  1. R2>en
  2. R2#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R2(config)#router ospf 1
  5. R2(config-router)#router-id 3.3.3.3
  6. R2(config-router)#network 192.168.1.4 0.0.0.3 area 0
  7. R2(config-router)#network 192.168.1.8 0.0.0.3 area 0
  8. R2(config-router)#network 172.16.1.0 0.0.0.3 area 0
  9. R2(config-router)#exit
  10. R2(config)#
复制代码

配置R3:
  1. R3>en
  2. R3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R3(config)#router ospf 1
  5. R3(config-router)#router-id 4.4.4.4
  6. R3(config-router)#network 172.16.1.0 0.0.0.3 area 0
  7. R3(config-router)#network 10.2.1.0 0.0.0.255 area 0
  8. R3(config-router)#network 10.2.2.0 0.0.0.255 area 0
  9. R3(config-router)#exit
  10. R3(config)#
复制代码

配置R4:
  1. R4>en
  2. R4#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R4(config)#router rip
  5. R4(config-router)#version 2
  6. R4(config-router)#no auto-summary
  7. R4(config-router)#network 1.1.1.0
  8. R4(config-router)#network 11.1.1.0
  9. R4(config-router)#exit
  10. R4(config)#
复制代码

测试总部PC与分公司PC的连通性:


查看路由表:
  1. R0#show ip ospf database
  2.             OSPF Router with ID (1.1.1.1) (Process ID 1)

  3.                 Router Link States (Area 0)

  4. Link ID         ADV Router      Age         Seq#       Checksum Link count
  5. 2.2.2.2         2.2.2.2         362         0x80000009 0x0071c8 4
  6. 1.1.1.1         1.1.1.1         356         0x80000005 0x00b4c4 2
  7. 3.3.3.3         3.3.3.3         274         0x80000006 0x00ff38 4
  8. 4.4.4.4         4.4.4.4         265         0x80000004 0x004a95 4

  9.                 Net Link States (Area 0)
  10. Link ID         ADV Router      Age         Seq#       Checksum
  11. 192.168.1.1     1.1.1.1         460         0x80000001 0x0079f3
  12. 192.168.1.5     2.2.2.2         362         0x80000001 0x0063f7
  13. 192.168.1.9     1.1.1.1         356         0x80000002 0x00f5fa

  14.                 Type-5 AS External Link States
  15. Link ID         ADV Router      Age         Seq#       Checksum Tag
  16. 0.0.0.0         1.1.1.1         545         0x80000001 0x00fecf 1

  17. R0#show ip route
  18. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
  19.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  20.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
  21.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
  22.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
  23.        * - candidate default, U - per-user static route, o - ODR
  24.        P - periodic downloaded static route

  25. Gateway of last resort is 0.0.0.0 to network 0.0.0.0

  26.      1.0.0.0/30 is subnetted, 1 subnets
  27. C       1.1.1.0 is directly connected, Serial0/0
  28.      10.0.0.0/24 is subnetted, 4 subnets
  29. O       10.1.1.0 [110/2] via 192.168.1.2, 00:07:44, FastEthernet0/1
  30. O       10.1.2.0 [110/2] via 192.168.1.2, 00:07:28, FastEthernet0/1
  31. O       10.2.1.0 [110/66] via 192.168.1.10, 00:04:27, FastEthernet0/0
  32. O       10.2.2.0 [110/66] via 192.168.1.10, 00:04:27, FastEthernet0/0
  33.      172.16.0.0/30 is subnetted, 1 subnets
  34. O       172.16.1.0 [110/65] via 192.168.1.10, 00:05:50, FastEthernet0/0
  35.      192.168.1.0/30 is subnetted, 3 subnets
  36. C       192.168.1.0 is directly connected, FastEthernet0/1
  37. O       192.168.1.4 [110/2] via 192.168.1.10, 00:05:50, FastEthernet0/0
  38.                     [110/2] via 192.168.1.2, 00:05:50, FastEthernet0/1
  39. C       192.168.1.8 is directly connected, FastEthernet0/0
  40. S*   0.0.0.0/0 is directly connected, Serial0/0

  41. R0#
复制代码

7、在分公司的路由器和交换机上分别配置虚拟终端VTY,使得总部PC能够以密码认证方式远程Telnet登录到分公司路由器,以账号、密码方式远程Telnet登录到分公司交换机进行管理,登录密码均为自己学号、账号为自己姓名拼音(10分)


配置Sw3:
  1. Sw3>en
  2. Sw3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Sw3(config)#vlan 99
  5. Sw3(config-vlan)#exit
  6. Sw3(config)#int vlan 99
  7. Sw3(config-if)#
  8. %LINK-5-CHANGED: Interface Vlan99, changed state to up

  9. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up

  10. Sw3(config-if)#ip add 10.2.99.1 255.255.255.0
  11. Sw3(config-if)#no sh
  12. Sw3(config-if)#exit
  13. Sw3(config)#user zhangsan privilege 15 password 88888888
  14. Sw3(config)#line vty 04
  15. Sw3(config-line)#login local
  16. Sw3(config-line)#exit
  17. Sw3(config)#
复制代码

配置Switch0:
  1. Switch0>en
  2. Switch0#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. Switch0(config)#vlan 99
  5. Switch0(config-vlan)#exit
  6. Switch0(config)#int vlan 99
  7. Switch0(config-if)#
  8. %LINK-5-CHANGED: Interface Vlan99, changed state to up

  9. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up

  10. Switch0(config-if)#ip add 10.2.99.2 255.255.255.0
  11. Switch0(config-if)#no sh
  12. Switch0(config-if)#exit
  13. Switch0(config)#line vty 0 4
  14. Switch0(config-line)#exit
  15. Switch0(config)#user zhangsan privilege 15 password 88888888
  16. Switch0(config)#line vty 0 4
  17. Switch0(config-line)#login local
  18. Switch0(config-line)#exit
  19. Switch0(config)#
复制代码

配置R3:
  1. R3>en
  2. R3#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R3(config)#int f0/0.99
  5. R3(config-subif)#
  6. %LINK-5-CHANGED: Interface FastEthernet0/0.99, changed state to up

  7. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.99, changed state to up

  8. R3(config-subif)#encapsulation dot1Q 99
  9. R3(config-subif)#ip add 10.2.99.254 255.255.255.0
  10. R3(config-subif)#no sh
  11. R3(config-subif)#ex
  12. R3(config)#user zhangsan privilege 15 password 88888888
  13. R3(config)#line vty 0 4
  14. R3(config-line)#login local
  15. R3(config-line)#exit
  16. R3(config)#
复制代码

测试总部PC与R3的连通性,并通过Telnet远程连接R3。

连接上R3后,在其远程终端通过Telnet远程连接分公司的两台交换机。


8、在总部路由器R1上进行ACL包过滤配置,要求分公司VLAN10的PC只能访问总部服务器S0,VLAN20的PC只能以WEB方式访问S1,其它禁止(15分)


配置R1:
  1. R1>en
  2. R1#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R1(config)#ip access-list extended ACL1
  5. R1(config-ext-nacl)#permit tcp 10.2.2.0 0.0.0.255 host 10.1.2.2 eq 80
  6. R1(config-ext-nacl)#permit tcp 10.2.2.0 0.0.0.255 host 10.1.2.2 eq 443
  7. R1(config-ext-nacl)#permit ip 10.2.1.0 0.0.0.255 host 10.1.2.1
  8. R1(config-ext-nacl)#deny ip 10.2.2.0 0.0.0.255 any
  9. R1(config-ext-nacl)#deny ip 10.2.1.0 0.0.0.255 any
  10. R1(config-ext-nacl)#permit ip any any
  11. R1(config-ext-nacl)#exit
  12. R1(config)#int ran f0/0-1
  13. R1(config-if-range)#ip access-group ACL1 in
  14. R1(config-if-range)#exit
  15. R1(config)#
复制代码

查看ACL表:
  1. R1#show ip access-lists
  2. Extended IP access list ACL1
  3.     10 permit ip 10.2.1.0 0.0.0.255 host 10.1.2.1 (4 match(es))
  4.     20 permit tcp 10.2.2.0 0.0.0.255 host 10.1.2.2 eq www (5 match(es))
  5.     30 permit tcp 10.2.2.0 0.0.0.255 host 10.1.2.2 eq 443
  6.     40 deny ip 10.2.2.0 0.0.0.255 any (12 match(es))
  7.     50 deny ip 10.2.1.0 0.0.0.255 any (12 match(es))
  8.     60 permit ip any any (48 match(es))
复制代码

测试连通性,分公司VLAN10只能访问总部S0:


分公司VLAN20只能通过Web访问S1:


S1-Web界面:


9、在私网与公网的边界路由器R0上进行PAT配置,使得总部用户可以访问公网,分公司都只有VLAN10的PC可以访问公网,PAT的转换公网地址是R0路由器连接公网的接口地址(15分)

配置R0:
  1. R0>en
  2. R0#conf t
  3. Enter configuration commands, one per line.  End with CNTL/Z.
  4. R0(config)#ip access-list standard PAT
  5. R0(config-std-nacl)#permit 10.1.0.0 0.0.255.255
  6. R0(config-std-nacl)#permit 10.2.1.0 0.0.0.255
  7. R0(config-std-nacl)#exit
  8. R0(config)#ip nat inside source list PAT int s0/0 overload
  9. R0(config)#int s0/0
  10. R0(config-if)#ip nat outside
  11. R0(config-if)#int ran f0/0-1
  12. R0(config-if-range)#ip nat inside
  13. R0(config-if-range)#exit
  14. R0(config)#
复制代码





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
站长提醒
请您在发表言论时,遵守当地法律法规。

9

主题

4

回帖

105

积分

管理员

积分
105
 楼主| 发表于 2023-6-14 23:52:49 | 显示全部楼层 来自 广东深圳
测试总部PC与公网的连通性:



测试分公司VLAN10 PC与公网的连通性:



测试分公司VLAN20 PC与公网的连通性:




查看NAT地址转换表:
  1. R0#show ip nat translations
  2. Pro  Inside global     Inside local       Outside local      Outside global
  3. icmp 1.1.1.1:1024      10.2.1.2:38        11.1.1.1:38        11.1.1.1:1024
  4. icmp 1.1.1.1:1025      10.2.1.2:39        11.1.1.1:39        11.1.1.1:1025
  5. icmp 1.1.1.1:1026      10.2.1.2:40        11.1.1.1:40        11.1.1.1:1026
  6. icmp 1.1.1.1:37        10.1.1.1:37        11.1.1.1:37        11.1.1.1:37
  7. icmp 1.1.1.1:38        10.1.1.1:38        11.1.1.1:38        11.1.1.1:38
  8. icmp 1.1.1.1:39        10.1.1.1:39        11.1.1.1:39        11.1.1.1:39
  9. icmp 1.1.1.1:40        10.1.1.1:40        11.1.1.1:40        11.1.1.1:40
  10. icmp 1.1.1.1:41        10.2.1.2:41        11.1.1.1:41        11.1.1.1:41
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|爱学习

GMT+8, 2025-12-16 05:26 , Processed in 0.025991 second(s), 21 queries .

Powered by Discuz!

Copyright ©2023 红旗在飘扬 , All Rights Reserved.

快速回复 返回顶部 返回列表