企业网三层架构实验

一.试验要求

二.实验拓扑图 

三.配置

(1)在SW1与SW2 之间创建二层通道,使两条链路逻辑的变为一条 

 interface Eth-Trunk1 
 port link-type trunk   //改变接口模式为trunk模式
 port trunk allow-pass vlan 2 to 4094
 interface GigabitEthernet0/0/2
 eth-trunk 1
 interface GigabitEthernet0/0/3
 eth-trunk 1

(2)在交换机上创建 vlan ,将PC2 和PC4 划分入vlan 2 中

 vlan 2
 interface Ethernet 0/0/2
 port link-type access
 port default vlan 2

(3)在各个交换机接口上,将接口模式调为trunk模式

 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

(4)开启stp(生成树)

 stp region-configuration
 region-name a
 instance 1 vlan 1
 instance 2 vlan 2
 active region-configuration


修改SW1为vlan 1 根网桥,vlan 2 的备份网桥,SW2为vlan2 的根网桥,vlan 1 的备份网桥

 stp instance 1 root primary
 stp instance 2 root secondary

(5)开启Svi,配置ip,并配置虚拟网关(网关冗余)
配置DHCP池,使得PC可以通过此获得IP。

sw1:
 interface Vlanif1
 ip address 172.16.1.1 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.1.10
 vrrp vrid 1 priority 101
 vrrp vrid 1 track interface GigabitEthernet0/0/1
 dhcp select global

 interface Vlanif2
 ip address 172.16.2.1 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.2.10
 dhcp select global

 ip pool a
 gateway-list 172.16.1.10
 network 172.16.1.0 mask 255.255.255.0
 dns-list 114.114.114.114
 ip pool b
 gateway-list 172.16.2.10 
 network 172.16.2.0 mask 255.255.255.0
 dns-list 114.114.114.114



sw2:
 interface Vlanif1
 ip address 172.16.1.2 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.1.10
 dhcp select global

 interface Vlanif2
 ip address 172.16.2.2 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.2.10
 vrrp vrid 1 priority 101
 vrrp vrid 1 track interface GigabitEthernet0/0/1
 dhcp select global

 ip pool a
 gateway-list 172.16.1.10
 network 172.16.1.0 mask 255.255.255.0
 dns-list 114.114.114.114
 ip pool b
 gateway-list 172.16.2.10
 network 172.16.2.0 mask 255.255.255.0
 dns-list 114.114.114.114

(6)将两个接口模式改为access模式

interface Vlanif3
ip address 172.16.0.1 255.255.255.252

interface Vlanif4
ip address 172.16.0.5 255.255.255.252

配置路由器IP,然后开启ospf路由协议,宣告网段,保证内网全网可达

ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.0.0 0.0.255.255

ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 172.16.0.0 0.0.255.255

ospf 1 router-id 1.1.1.1 
default-route-advertise always
area 0.0.0.0 
network 172.16.0.0 0.0.255.255 

(7)制定ACl、NAT,使得内网可以访问互联网

acl number 2000  
rule 5 permit source 172.16.0.0 0.0.255.255 
nat out bound 2000

四.测试

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值