实验拓扑
获取地址
项目连接
实验步骤
SW1
配置的接口
配置的DHCP
配置缺省路由
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
DHCP配置在交换机SW2上
1.dhcp enable
2.ip pool 1
network 192.168.1.0 mask 255.255.255.0
dns-list 192.168.4.1
gateway-list 192.168.1.254
#excluded-ip-address #可选
#excluded-ip-address 10.1.1.4
#lease day 10
3.vlan batch 10 20
4.int vlanif 10
ip address 192.168.1.254 255.255.255.0
dhcp select global
5.display ip pool
AR1
配置接口
配置nat
配置地址组
配置acl
进入端口使用acl
配置缺省路由
配置静态路由
acl number 2000
rule 5 permit source 192.168.0.0 0.0.255.255
nat address-group 1 202.1.1.3 202.1.1.5
#
interface GigabitEthernet0/0/0
ip address 192.168.3.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 202.1.1.1 255.255.255.0
nat outbound 2000 address-group 1
#
ip route 0.0.0.0 0.0.0.0 202.1.1.2
ip route 192.168.0.0 16 192.168.3.1
SW2
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.1.254 255.255.255.0
dhcp select global
#
interface Vlanif20
ip address 192.168.2.254 255.255.255.0
dhcp select global
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.4.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 40
#
ip route-static 0.0.0.0 0.0.0.0 192.168.3.2
SW4
interface Vlanif10
ip address 202.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 66.66.66.254 255.0.0.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
ip route-static 202.1.1.0 24 66.66.66.254
sw3
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
DNS配置
DHCP 抓包
pc5 ping www.baicu.com