2 网段 Vlan+NAT 配置

简介:

拓扑概述:
    SW1 划分 Vlan 10、20,分别连接 PC1 和 PC2。
    Vlan10: 172.16.1.0/24,网关 172.16.1.254
    Vlan20: 172.16.2.0/24,网关 172.16.2.254
   
    Vlan1 网关 172.16.3.1,连接 RT1。
    在 RT1 上做 NAT。RT1 fa0/0 ip=172.16.3.2
   
    RT2 作为一台 PC 测试用,IP=172.16.4.2。

记录:
    基本调试成功。
    1,需要在 RT1 上做回程路由。
       能不能通过路由汇聚什么的,简化配置?
       已知:可以通过配置 Rip 等路由协议简化路由配置。
    2,为什么 PC1 和 PC2 能 ping 通 172.16.4.2,而不能 ping 通 172.16.4.1?
    2,为什么 RT2 也不能 ping 通 172.16.4.1?   

PC1>en
PC1#copy run start
Destination filename [startup-config]?
Building configuration…
[OK]
PC1#sh run
Building configuration…

Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname PC1
!
!
memory-size iomem 15
ip subnet-zero
!
!
interface Loopback0
 no ip address
!
interface FastEthernet0/0
 ip address 172.16.1.100 255.255.255.0
 speed auto
 full-duplex
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.16.1.254
no ip http server
!
no cdp run
!
line con 0
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end

PC1#

==================================
PC2#sh run
Building configuration…

Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname PC2
!
!
memory-size iomem 15
ip subnet-zero
!
!
interface Loopback0
 no ip address
!
interface FastEthernet0/0
 ip address 172.16.2.100 255.255.255.0
 speed auto
 full-duplex
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.16.2.254
no ip http server
!
no cdp run
!
line con 0
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end

==================================

SW1#sh run
Building configuration…

Current configuration : 1090 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
interface FastEthernet1/0
!
interface FastEthernet1/1
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
 switchport access vlan 10
!
interface FastEthernet1/12
 switchport access vlan 20
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface Vlan1
 ip address 172.16.3.1 255.255.255.0
!
interface Vlan10
 ip address 172.16.1.254 255.255.255.0
!
interface Vlan20
 ip address 172.16.2.254 255.255.255.0
!
ip http server
ip route 0.0.0.0 0.0.0.0 172.16.3.2
!
no cdp run
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

==================================

RT1#sh run
Building configuration…

Current configuration : 1151 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname RT1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
multilink bundle-name authenticated
!
!
interface FastEthernet0/0
 ip address 172.16.3.2 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 172.16.4.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip route 172.16.1.0 255.255.255.0 172.16.3.1
ip route 172.16.2.0 255.255.255.0 172.16.3.1
!
!
ip http server
no ip http secure-server
ip nat pool pool1 172.16.4.1 172.16.4.1 netmask 255.255.255.0
ip nat inside source list 1 pool pool1 overload
!
!
access-list 1 permit 172.16.1.0 0.0.0.250
access-list 1 permit 172.16.2.0 0.0.0.250

control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
end

===============================

RT2#sh run
Building configuration…

Current configuration : 874 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname RT2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
multilink bundle-name authenticated
!
interface FastEthernet0/0
 ip address 172.16.5.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 172.16.4.2 255.255.255.0
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
!
!
end














本文转自网眼51CTO博客,原文链接:http://blog.51cto.com/itwatch/286605,如需转载请自行联系原作者

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
相关文章
|
Linux 虚拟化
VMware workstation 中centos7虚拟机在nat模式下怎么配置网卡,指定我想要的IP并且可以联网
https://blog.csdn.net/2302_78534730/article/details/132825156?spm=1001.2014.3001.5502
846 0
|
存储 网络协议 安全
30 道初级网络工程师面试题,涵盖 OSI 模型、TCP/IP 协议栈、IP 地址、子网掩码、VLAN、STP、DHCP、DNS、防火墙、NAT、VPN 等基础知识和技术,帮助小白们充分准备面试,顺利踏入职场
本文精选了 30 道初级网络工程师面试题,涵盖 OSI 模型、TCP/IP 协议栈、IP 地址、子网掩码、VLAN、STP、DHCP、DNS、防火墙、NAT、VPN 等基础知识和技术,帮助小白们充分准备面试,顺利踏入职场。
1710 2
|
网络协议 安全 网络安全
Cisco-网络端口地址转换NAPT配置
Cisco-网络端口地址转换NAPT配置
339 1
|
安全 网络安全 数据安全/隐私保护
手把手教你用eNSP模拟器配置防火墙源NAT
手把手教你用eNSP模拟器配置防火墙源NAT
2065 4
ENSP Nat地址转换(配置命令 )
ENSP Nat地址转换(配置命令 )
499 1
|
弹性计算 Linux 网络安全
三步搭建VPC专有网络NAT网关,配置SNAT和DNAT规则(补充版)
申明:该文档参考于用户 “帅宝宝”的文档进行的优化,新增永久生效的方式
1774 1
|
安全 数据安全/隐私保护 网络架构
ensp中nat地址转换(静态nat 动态nat NAPT 和Easy IP)配置命令
ensp中nat地址转换(静态nat 动态nat NAPT 和Easy IP)配置命令
2585 0
|
域名解析 网络协议
NAT实验和配置
NAT实验和配置
248 0
|
弹性计算 运维 网络架构
【运维知识进阶篇】用阿里云配置NAT网关配置
【运维知识进阶篇】用阿里云配置NAT网关配置
807 0
|
运维 Shell 网络安全
【运维知识进阶篇】iptables防火墙详解(iptables执行过程+表与链概述+iptables命令参数+配置filter表规则+NAT表实现共享上网、端口转发、IP映射)(三)
【运维知识进阶篇】iptables防火墙详解(iptables执行过程+表与链概述+iptables命令参数+配置filter表规则+NAT表实现共享上网、端口转发、IP映射)(三)
2727 0