思科三层交换环境的管理VLAN+NAT

本文详细描述了企业网络中接入层、汇聚层交换机的配置,出口网关路由器的IP地址分配和访问控制列表设置,以及PC的静态IP配置。强调了注意事项,如配置网关、启用三层链路和路由功能等。
摘要由CSDN通过智能技术生成

目录

接入层交换机配置

汇聚层交换机配置

出口网关路由器

ISP路由器

PC配置

注意事项


接入层交换机配置

hostname AS
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
!
interface FastEthernet0/3
 switchport mode trunk
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan255
 ip address 192.168.255.1 255.255.255.0
!
ip default-gateway 192.168.255.254
!
!
line con 0
!
line vty 0 4
 password 1234
 login
line vty 5 15
 login
 

汇聚层交换机配置

hostname CO
!
ip routing
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/2
 no switchport
 ip address 192.168.99.1 255.255.255.0
 duplex auto
 speed auto
!
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 mac-address 0060.3e9c.dc01
 ip address 192.168.10.254 255.255.255.0
!
interface Vlan20
 mac-address 0060.3e9c.dc02
 ip address 192.168.20.254 255.255.255.0
!
interface Vlan255
 mac-address 0060.3e9c.dc03
 ip address 192.168.255.254 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.99.2 
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login

出口网关路由器


hostname R1
!
ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface FastEthernet0/0
 ip address 192.168.99.2 255.255.255.0
 ip nat inside
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 202.101.100.1 255.255.255.0
 ip nat outside
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip nat inside source list 1 interface FastEthernet0/1 overload
ip classless
ip route 192.168.0.0 255.255.0.0 192.168.99.1 
ip route 0.0.0.0 0.0.0.0 202.101.100.2 
!
ip flow-export version 9
!
access-list 1 permit 192.168.0.0 0.0.255.255
!
line con 0
!
line aux 0
!
line vty 0 4
 login

ISP路由器

hostname ISP
!
ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface Loopback0
 ip address 8.8.8.8 255.255.255.255
!
interface FastEthernet0/0
 ip address 202.101.100.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login

PC配置

手工配置IP和网关

注意事项

  • 二层接入交换机记得配网关,不然无法回包;
  • 三层交换机与出口网关之间启用三层链路,隔绝广播;
  • 三层交换机记得开启路由功能,学习直连网段,否则VLAN间无法互访;

  • 36
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值