一、实验内容:
二、实验拓扑图:
三、实验操作:
配置VLAN:
SW1,SW2:(二层交换机)
vlan 2
#
interface Ethernet0/0/1
port link-type access
#
interface Ethernet0/0/2
port link-type access
port default vlan 2
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2
STP:
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
SW3,SW4(三层交换机)
配置VLAN(基础配置)
vlan 2
interface Eth-Trunk0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
stp edged-port enable
#
interface GigabitEthernet0/0/3
eth-trunk 0
#
interface GigabitEthernet0/0/4
eth-trunk 0
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2
配置SVI:
nterface Vlanif1
ip address 172.16.1.1 255.255.255.128
vrrp vrid 1 virtual-ip 172.16.1.126
vrrp vrid 1 priority 101
vrrp vrid 1 track interface GigabitEthernet0/0/2 reduced 2
dhcp select global
#
interface Vlanif2
ip address 172.16.1.129 255.255.255.128
vrrp vrid 1 virtual-ip 172.16.1.254
dhcp select global
#
interface Vlanif100
ip address 172.16.0.1 255.255.255.252
int vlanif 1
vrrp vrid 1 virtual-ip 172.16.1.126
vrrp vrid 1 priority 101
vrrp vrid 1 track interface GigabitEthernet0/0/2 reduced 2
int vlanif 2
vrrp vrid 1 virtual-ip 172.16.1.254
然后在R1上,做一条缺省指向外网,在OSPF中也做一下缺省的下放,实现内网都可以拿到缺省:
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
acl number 2000
rule permit source 172.16.0.0 16
int g0/0/2
nat outbound 2000
在PC上查看IP: