文章目录
IP动态NAT和静态NAT配置实验
实验拓扑图
Router0配置
一、基本配置
interface FastEthernet0/0
no shut
ip address 10.1.1.2 255.255.255.252
ip nat inside
exi
interface FastEthernet0/1
no shut
ip address 211.1.1.1 255.255.255.252
ip nat outside
exi
二、动态NAT转换配置
ip nat pool NAT-POOL 117.1.1.1 117.1.1.14 netmask 255.255.255.240
ip access-list standard NAT-ACL
permit 192.168.0.0 0.0.255.255
exi
ip nat inside source list NAT-ACL pool NAT-POOL overload
三、路由配置
ip route 0.0.0.0 0.0.0.0 211.1.1.2
ip route 192.168.0.0 255.255.0.0 10.1.1.1
Router1配置
一、基本配置
interface FastEthernet0/0
no shut
ip address 222.1.1.1 255.255.255.252
exi
interface FastEthernet0/1
no shut
ip address 211.1.1.2 255.255.255.252
exi
二、路由配置
ip route 117.1.1.0 255.255.255.0 211.1.1.1
ip route 202.1.1.0 255.255.255.0 222.1.1.2
Router2配置
一、基本配置
interface FastEthernet0/0
no shut
ip nat outside
ip address 222.1.1.2 255.255.255.252
exi
interface FastEthernet0/1
no shut
ip nat inside
ip address 192.168.10.254 255.255.255.0
exi
二、静态NAT转换配置
ip nat inside source static 192.168.10.1 202.1.1.1
二、路由配置
ip route 0.0.0.0 0.0.0.0 222.1.1.1
三层交换机配置(从上往下)
Multilayer Switch0
interface FastEthernet0/10
no switchport
ip address 10.1.1.1 255.255.255.252
exi
interface FastEthernet0/1
no switchport
ip address 172.16.1.1 255.255.255.252
exi
interface FastEthernet0/2
no switchport
ip address 172.16.1.5 255.255.255.252
exi
ip route 0.0.0.0 0.0.0.0 10.1.1.2
ip route 192.168.0.0 255.255.0.0 172.16.1.2
ip route 192.168.0.0 255.255.0.0 172.16.1.6
ip routing
Multilayer Switch1配置
interface FastEthernet0/1
no switchport
ip address 172.16.1.2 255.255.255.252
exi
interface FastEthernet0/3
switchport access vlan 10
exi
interface Vlan10
ip address 192.168.10.254 255.255.255.0
exi
interface FastEthernet0/4
switchport access vlan 20
exi
interface Vlan20
ip address 192.168.20.254 255.255.255.0
exi
ip route 202.1.1.0 255.255.255.0 172.16.1.1
ip routing
Multilayer Switch2配置
interface FastEthernet0/2
no switchport
ip address 172.16.1.6 255.255.255.252
exi
interface FastEthernet0/5
switchport access vlan 30
exi
interface Vlan30
ip address 192.168.30.254 255.255.255.0
exi
interface FastEthernet0/6
switchport access vlan 40
exi
interface Vlan40
ip address 192.168.40.254 255.255.255.0
exi
ip route 202.1.1.0 255.255.255.0 172.16.1.5
ip routing
最后四台电脑都能ping通服务器的外网ip(202.1.1.1),如果还需要四台电脑互通的话,
在Multilayer Switch1加上到PC2和PC3网段的路由
在Multilayer Switch2加上到PC0和PC1网段的路由