十、CCNP-交换综合试验

10.1 需求说明

10.2 拓扑绘制及分析

分析:

  • PC1:关闭路由功能、接口上启动DHCP自动获取地址;
  • PC2:关闭路由功能、接口上启动DHCP自动获取地址;
  • DHCP:关闭路由功能,启动DHCP服务,设置默认网关,配置VLAN10和VLAN20的地址池及默认路由;
  • APP:关闭路由功能,设置接口地址,设置默认网关;
  • SW3:关闭路由功能;创建VLAN10(PC1)、VLAN20(PC2通过)、VLAN255(管理);设置ACCESS和TRUNK接口;配置VLAN255的管理地址及默认网关指向SW2的VLAN255地址;
  • SW4:关闭路由功能;创建VLAN20(PC2)、VLAN255(管理);设置ACCESS和TRUNK接口;配置VLAN255的管理地址;
  • SW1:启用路由功能;创建VLAN100(服务器群)和VLAN255(管理);设置接口ACCESS和TRUNK属性;配置VLAN100地址,作为服务器群网关地址;配置VLAN255地址,作为管理地址;
  • SW2:启用路由功能;创建VLAN10、VLAN20、VLAN255(管理);设置接口ACCESS和TRUNK属性;配置VLAN100地址,作为服务器群网关地址;配置VLAN10地址,作为PC1的网关;配置VLAN20地址,作为PC2的网关;配置VLAN255地址,作为管理地址;启动外连接口三层功能,设置互联地址;设置VLAN10和VLAN20的DHCP穿透单播功能;
  • 在SW2上配置去往服务器群的下一跳为SW1的管理地址;SW1上配置默认路由为SW2的管理地址;
  • OR:启动路由功能;启动内连和外连接口三层功能并设置IP地址;设置默认外网路由以及对内回程路由;启动PAT功能,将内网段访问外网转换为OR连接外网接口的IP地址;
  • WAN:启动路由功能;启动接口三层功能并设置互联地址;设置LOOKBACK地址作为测试外网IP使用;
  • 在SW2上启动默认外网访问路由;

10.3 配置

10.3.1 PC1配置

DHCP自动分配IP地址,只需要启动服务即可

PC1-VLAN10(config)#no ip routing
PC1-VLAN10(config)#interface fastEthernet 0/0
PC1-VLAN10(config-if)#ip address dhcp
PC1-VLAN10(config-if)#no shutdown

10.3.2 PC2配置

DHCP自动分配IP地址,只需要启动服务即可

PC2-VLAN20(config)#no ip routing
PC2-VLAN20(config)#interface fastEthernet 0/0
PC2-VLAN20(config-if)#ip address dhcp
PC2-VLAN20(config-if)#no shutdown

10.3.3 DHCP配置

关闭路由,启动DHCP服务

DHCPServer-VLAN100(config)#no ip routing
DHCPServer-VLAN100(config)#service dhcp

配置接口地址

DHCPServer-VLAN100(config)#interface fastEthernet 0/0
DHCPServer-VLAN100(config-if)#ip address 192.168.100.100 255.255.255.0
DHCPServer-VLAN100(config-if)#no shutdown

配置网关

DHCPServer-VLAN100(config)#ip default-gateway 192.168.100.254

配置VLAN10地址池及网关

DHCPServer-VLAN100(config)#ip dhcp pool vlan10
DHCPServer-VLAN100(dhcp-config)#network 192.168.10.0 /24 
DHCPServer-VLAN100(dhcp-config)#default-router 192.168.10.254

配置VLAN20地址池及网关

DHCPServer-VLAN100(config)#ip dhcp pool vlan20
DHCPServer-VLAN100(dhcp-config)#network 192.168.20.0 /24 
DHCPServer-VLAN100(dhcp-config)#default-router 192.168.20.254

查看接口信息

DHCPServer-VLAN100#show ip interface brief

DHCPServer-VLAN100#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.100.100 YES manual up                    up

10.3.4 AppServer配置

关闭路由,配置地址

AppServer-VLAN100(config)#no ip routing
AppServer-VLAN100(config)#interface fastEthernet 0/0
AppServer-VLAN100(config-if)#ip address 192.168.100.1 255.255.255.0
AppServer-VLAN100(config-if)#no shutdown

配置网关

AppServer-VLAN100(config)#ip default-gateway 192.168.100.254

查看接口信息

AppServer-VLAN100#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.100.1   YES manual up                    up

10.3.5 AS-SW3配置

关闭路由

AS-SW3(config)#no ip routing

创建VLAN10、20、255

AS-SW3#vlan database
AS-SW3(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
AS-SW3(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
AS-SW3(vlan)#vlan 255
VLAN 255 added:
    Name: VLAN0255
AS-SW3(vlan)#exit

设置接口TRUNK和ACCESS属性

AS-SW3(config)#interface fastEthernet 0/1
AS-SW3(config-if)#switchport mode access
AS-SW3(config-if)#switchport access vlan 10
AS-SW3(config-if)#no shutdown

AS-SW3(config)#interface fastEthernet 0/2
AS-SW3(config-if)#switchport trunk encapsulation dot1q
AS-SW3(config-if)#switchport mode trunk
AS-SW3(config-if)#no shutdown

AS-SW3(config)#interface fastEthernet 0/15
AS-SW3(config-if)#switchport trunk encapsulation dot1q
AS-SW3(config-if)#switchport mode trunk
AS-SW3(config-if)#no shutdown

查看VLAN信息

AS-SW3#show vlan-switch

AS-SW3#show vlan-switch

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14
10   VLAN0010                         active    Fa0/1
20   VLAN0020                         active
255  VLAN0255                         active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
255  enet  100255     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0
1005 trnet 101005     1500  -      -      1        ibm  -        0      0

查看TRUNK信息

AS-SW3#show interfaces trunk

AS-SW3#show interfaces trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa0/2     on           802.1q         trunking      1
Fa0/15    on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/2     1-1005
Fa0/15    1-1005

Port      Vlans allowed and active in management domain
Fa0/2     1,10,20,255
Fa0/15    1,10,20,255

Port      Vlans in spanning tree forwarding state and not pruned
Fa0/2     1,10,20,255
Fa0/15    1,10,20,255

配置VLAN255管理地址

AS-SW3(config)#interface vlan 255
AS-SW3(config-if)#ip address 192.168.255.1 255.255.255.0
AS-SW3(config-if)#no shutdown

配置默认网关,管理VLAN使用

AS-SW3(config)#ip default-gateway 192.168.255.254

10.3.6 AS-SW4配置

关闭路由

AS-SW4(config)#no ip routing

创建VLAN20、255

AS-SW4#vlan database
AS-SW4(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
AS-SW4(vlan)#vlan 255
VLAN 255 added:
Name: VLAN0255

设置接口ACCESS和TRUNK属性

AS-SW4(config)#interface fastEthernet 0/1
AS-SW4(config-if)#switchport mode access
AS-SW4(config-if)#switchport access vlan 20
AS-SW4(config-if)#no shutdown

AS-SW4(config)#interface fastEthernet 0/2
AS-SW4(config-if)#switchport trunk encapsulation dot1q
AS-SW4(config-if)#switchport mode trunk
AS-SW4(config-if)#no shutdown

设置管理VLAN255地址

AS-SW4(config)#interface vlan 255
AS-SW4(config-if)#ip address 192.168.255.2 255.255.255.0
AS-SW4(config-if)#no shutdown

查看接口信息

AS-SW4#show ip interface brief

AS-SW4#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  up                    down
FastEthernet0/1            unassigned      YES unset  up                    up
FastEthernet0/2            unassigned      YES unset  up                    up
FastEthernet0/3            unassigned      YES unset  up                    down
FastEthernet0/4            unassigned      YES unset  up                    down
FastEthernet0/5            unassigned      YES unset  up                    down
FastEthernet0/6            unassigned      YES unset  up                    down
FastEthernet0/7            unassigned      YES unset  up                    down
FastEthernet0/8            unassigned      YES unset  up                    down
FastEthernet0/9            unassigned      YES unset  up                    down
FastEthernet0/10           unassigned      YES unset  up                    down
FastEthernet0/11           unassigned      YES unset  up                    down
FastEthernet0/12           unassigned      YES unset  up                    down
FastEthernet0/13           unassigned      YES unset  up                    down
FastEthernet0/14           unassigned      YES unset  up                    down
FastEthernet0/15           unassigned      YES unset  up                    down
Vlan1                      unassigned      YES unset  up                    up
Vlan255                    192.168.255.2   YES manual up                    up

查看VLAN信息

AS-SW4#show interfaces trunk

AS-SW4#show interfaces trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa0/2     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/2     1-1005

Port      Vlans allowed and active in management domain
Fa0/2     1,20,255

Port      Vlans in spanning tree forwarding state and not pruned
Fa0/2     1,20,255

10.3.7 CO-SW1配置

CO-SW1(config)#ip routing

创建VLAN100和255

CO-SW1#vlan database
CO-SW1(vlan)#vlan 100
VLAN 100 added:
    Name: VLAN0100
CO-SW1(vlan)#vlan 255
VLAN 255 added:
    Name: VLAN0255

查看VLAN信息

CO-SW1#show vlan-switch

CO-SW1#show vlan-switch

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3
                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13, Fa0/14, Fa0/15
100  VLAN0100                         active
255  VLAN0255                         active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
100  enet  100100     1500  -      -      -        -    -        0      0
255  enet  100255     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0
1005 trnet 101005     1500  -      -      1        ibm  -        0      0

设置接口ACCESS和TRUNK属性

CO-SW1(config)#interface range fastEthernet 0/1 - 2
CO-SW1(config-if-range)#switchport mode access
CO-SW1(config-if-range)#switchport access vlan 100
CO-SW1(config-if-range)#no shutdown

CO-SW1(config)#interface fastEthernet 0/5
CO-SW1(config-if)#switchport trunk encapsulation dot1q
CO-SW1(config-if)#switchport mode trunk
CO-SW1(config-if)#no shutdown

设置VLAN100地址,作为网关

CO-SW1(config)#interface vlan 100
CO-SW1(config-if)#ip address 192.168.100.254 255.255.255.0
CO-SW1(config-if)#no shutdown

设置管理VLAN255地址

CO-SW1(config)#interface vlan 255
CO-SW1(config-if)#ip address 192.168.255.253 255.255.255.0
CO-SW1(config-if)#no shutdown

查看接口信息

CO-SW1#show ip interface brief

CO-SW1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  up                    down
FastEthernet0/1            unassigned      YES unset  up                    up
FastEthernet0/2            unassigned      YES unset  up                    up
FastEthernet0/3            unassigned      YES unset  up                    down
FastEthernet0/4            unassigned      YES unset  up                    down
FastEthernet0/5            unassigned      YES unset  up                    up
FastEthernet0/6            unassigned      YES unset  up                    down
FastEthernet0/7            unassigned      YES unset  up                    down
FastEthernet0/8            unassigned      YES unset  up                    down
FastEthernet0/9            unassigned      YES unset  up                    down
FastEthernet0/10           unassigned      YES unset  up                    down
FastEthernet0/11           unassigned      YES unset  up                    down
FastEthernet0/12           unassigned      YES unset  up                    down
FastEthernet0/13           unassigned      YES unset  up                    down
FastEthernet0/14           unassigned      YES unset  up                    down
FastEthernet0/15           unassigned      YES unset  up                    down
Vlan1                      unassigned      YES unset  up                    up
Vlan100                    192.168.100.254 YES manual up                    up
Vlan255                    192.168.255.253 YES manual up                    up

10.3.8 测试1

测试DHCP服务器到网关

DHCPServer-VLAN100#ping 192.168.100.254

DHCPServer-VLAN100#ping 192.168.100.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/268/1072 ms

测试APP服务器到网关

AppServer-VLAN100#ping 192.168.100.254

AppServer-VLAN100#ping 192.168.100.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/289/1048 ms

10.3.9 CO-SW2配置

CO-SW2(config)#ip routing

创建VLAN10、20、255

CO-SW2#vlan databa
CO-SW2#vlan database
CO-SW2(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
CO-SW2(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
CO-SW2(vlan)#vlan 255
VLAN 255 added:
    Name: VLAN0255

设置接口TRUNK属性

CO-SW2(config)#interface fastEthernet 0/15
CO-SW2(config-if)#switchport trunk encapsulation dot1q
CO-SW2(config-if)#switchport mode trunk
CO-SW2(config-if)#no shutdown

CO-SW2(config)#interface fastEthernet 0/5
CO-SW2(config-if)#switchport trunk encapsulation dot1q
CO-SW2(config-if)#switchport mode trunk
CO-SW2(config-if)#no shutdown

设置VLAN10地址,作为PC1的网关

CO-SW2(config)#interface vlan 10
CO-SW2(config-if)#ip address 192.168.10.254 255.255.255.0
CO-SW2(config-if)#no shutdown

设置VLAN20地址,作为PC2的网关

CO-SW2(config)#interface vlan 20
CO-SW2(config-if)#ip address 192.168.20.254 255.255.255.0
CO-SW2(config-if)#no shutdown

设置管理VLAN255          地址

CO-SW2(config)#interface vlan 255
CO-SW2(config-if)#ip address 192.168.255.254 255.255.255.0
CO-SW2(config-if)#no shutdown

查看接口信息

CO-SW2#show ip interface brief

CO-SW2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  up                    down
FastEthernet0/1            unassigned      YES unset  up                    down
FastEthernet0/2            unassigned      YES unset  up                    down
FastEthernet0/3            unassigned      YES unset  up                    down
FastEthernet0/4            unassigned      YES unset  up                    down
FastEthernet0/5            unassigned      YES unset  up                    up
FastEthernet0/6            unassigned      YES unset  up                    down
FastEthernet0/7            unassigned      YES unset  up                    down
FastEthernet0/8            unassigned      YES unset  up                    down
FastEthernet0/9            unassigned      YES unset  up                    down
FastEthernet0/10           unassigned      YES unset  up                    up
FastEthernet0/11           unassigned      YES unset  up                    down
FastEthernet0/12           unassigned      YES unset  up                    down
FastEthernet0/13           unassigned      YES unset  up                    down
FastEthernet0/14           unassigned      YES unset  up                    down
FastEthernet0/15           unassigned      YES unset  up                    up
Vlan1                      unassigned      YES unset  up                    up
Vlan10                     192.168.10.254  YES manual up                    up
Vlan20                     192.168.20.254  YES manual up                    up
Vlan255                    192.168.255.254 YES manual up                    up

查看TRUNK信息

CO-SW2#show interfaces trunk

CO-SW2#show interfaces trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa0/5     on           802.1q         trunking      1
Fa0/15    on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/5     1-1005
Fa0/15    1-1005

Port      Vlans allowed and active in management domain
Fa0/5     1,10,20,255
Fa0/15    1,10,20,255

Port      Vlans in spanning tree forwarding state and not pruned
Fa0/5     1,10,20,255
Fa0/15    1,10,20,255

设置外连接口IP地址,启动三层接口

CO-SW2(config)#interface fastEthernet 0/10
CO-SW2(config-if)#no switchport
CO-SW2(config-if)#ip address 192.168.254.1 255.255.255.252
CO-SW2(config-if)#no shutdown

DHCP广播穿透变单播,从SVI10

CO-SW2(config)#interface vlan 10
CO-SW2(config-if)#ip helper-address 192.168.100.100
CO-SW2(config)#interface vlan 20
CO-SW2(config-if)#ip helper-address 192.168.100.100

10.3.10 路由配置1

去集群方向,网SW1走,管理IP同时也作为沟通桥梁,因为未启动三层接口,接口没有配置IP地址

CO-SW2(config)#ip route 192.168.100.0 255.255.255.0 192.168.255.253

SW1默认路由指向SW2的SVI255

CO-SW1(config)#ip route 0.0.0.0 0.0.0.0 192.168.255.254

10.3.11 测试2

查看PC1是否自动分配到了IP地址

PC1-VLAN10#show ip interface brief

PC1-VLAN10#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.10.1    YES DHCP   up                    up

PC1测试PING网关

PC1-VLAN10#ping 192.168.10.254

PC1-VLAN10#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/274/1076 ms

查看PC2是否自动分配到了IP地址

PC2-VLAN20#show ip interface brief

PC2-VLAN20#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.20.1    YES DHCP   up                    up  

PC2测试PING网关

PC2-VLAN20#ping 192.168.20.254

PC2-VLAN20#ping 192.168.20.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/96/180 ms

10.3.12 OR配置

OR(config)#ip routing

启动三层接口功能,设置接口IP地址

OR(config)#interface fastEthernet 0/10
OR(config-if)#no switchport
OR(config-if)#ip address 192.168.254.2 255.255.255.252
OR(config-if)#no shutdown

OR(config)#interface fastEthernet 0/1
OR(config-if)#no switchport
OR(config-if)#ip address 202.101.100.1 255.255.255.240
OR(config-if)#no shutdown

设置默认路由

OR(config)#ip route 0.0.0.0 0.0.0.0 202.101.100.2

设置回程路由

OR(config)#ip route 192.168.0.0 255.255.0.0 192.168.254.1

定义ACL,限制可以进行PAT转换的内网地址

OR(config)#access-list 1 permit 192.168.0.0 0.0.255.255 

配置ACL和路由器外端口的映射

OR(config)#ip nat inside source list 1 interface fastEthernet 0/1 overload

设置入口方向

OR(config)#interface fastEthernet 0/10
OR(config-if)#ip nat inside

设置出口方向

OR(config)#interface fastEthernet 0/1
OR(config-if)#ip nat outside

10.3.13 WAN配置

WAN(config)#ip routing

启动三层接口,配置接口地址

WAN(config)#interface fastEthernet 0/1
WAN(config-if)#no switchport
WAN(config-if)#ip address 202.101.100.2 255.255.255.240
WAN(config-if)#no shutdown

配置LOOPBACK地址,测试使用

WAN(config)#interface loopback 0
WAN(config-if)#ip address 200.200.200.200 255.255.255.255
WAN(config-if)#no shutdown

10.3.14 路由配置2

配置默认出外网路由,这个启动了三层,直接使用三层接口地址,不用VLAN255管理地址

CO-SW2(config)#ip route 0.0.0.0 0.0.0.0 192.168.254.2

10.3.15 测试3

PC1访问外网测试

PC1-VLAN10#ping 200.200.200.200

PC1-VLAN10#ping 200.200.200.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 180/214/280 ms

PC2访问外网测试

PC2-VLAN20#ping 200.200.200.200

PC2-VLAN20#ping 200.200.200.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 188/214/252 ms

APP服务器访问外网测试

AppServer-VLAN100#ping 200.200.200.200

AppServer-VLAN100#ping 200.200.200.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 252/275/296 ms

PC1访问APP服务器

PC1-VLAN10#ping 192.168.100.1

PC1-VLAN10#ping 192.168.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/334/1132 ms

PC2访问APP服务器

PC2-VLAN20#ping 192.168.100.1

PC2-VLAN20#ping 192.168.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 176/205/240 ms

PC1访问SW3交换机

PC1-VLAN10#ping 192.168.255.1

PC1-VLAN10#ping 192.168.255.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.255.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/125/152 ms

PC1访问SW4交换机

PC1-VLAN10#ping 192.168.255.2

PC1-VLAN10#ping 192.168.255.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.255.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/151/184 ms

PC1访问SW1交换机

PC1-VLAN10#ping 192.168.255.253

PC1-VLAN10#ping 192.168.255.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.255.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/324/1108 ms

PC1访问SW2交换机

PC1-VLAN10#ping 192.168.255.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.255.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/262/1056 ms

10.4 外网访问APP服务

在APP服务器上启动HTTP服务

AppServer-VLAN100(config)#ip http server

设置静态NAT转换,80端口到8080端口映射,内网和外网地址映射

OR(config)#$de source static tcp 192.168.100.1 80 202.101.100.3 8080

查看转换情况

OR#show ip nat translations

OR#show ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
tcp 202.101.100.3:8080 192.168.100.1:80   ---                ---

10.4.1 测试

从外网TELNET APP服务器

WAN#telnet 202.101.100.3 8080

WAN#telnet 202.101.100.3 8080
Trying 202.101.100.3, 8080 ... Open

查看TELENT结果

AppServer-VLAN100#show tcp brief

AppServer-VLAN100#show tcp brief
TCB       Local Address           Foreign Address        (state)
64AC303C  192.168.100.1.80        202.101.100.2.59305    ESTAB

发表回复