核心交换机配置DHCP服务
[SW1]dhcp enable
[SW1]ip pool 10
Info:It's successful to create an IP address pool.
[SW1-ip-pool-10]network 192.168.10.0 mask 255.255.255.0
[SW1-ip-pool-10]gateway-list 192.168.10.1
[SW1-ip-pool-10]dns-list 114.114.114.114 8.8.8.8
[SW1-ip-pool-10]display this
#
ip pool 10
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
dns-list 114.114.114.114 8.8.8.8
#
return
[SW1-ip-pool-10]quit
[SW1]ip pool 20
Info:It's successful to create an IP address pool.
[SW1-ip-pool-20]network 192.168.20.0 ma
[SW1-ip-pool-20]network 192.168.20.0 mask 255.255.255.0
[SW1-ip-pool-20]gateway-list 192.168.20.1
[SW1-ip-pool-20]dns-list 114.114.114.114 8.8.8.8
[SW1-ip-pool-20]quit
核心交换机SVI启用DHCP全局模式
[SW1]int Vlanif 10
[SW1-Vlanif10]dhcp select global
[SW1-Vlanif10]quit
[SW1]int vlanif20
[SW1-Vlanif20]dhcp select global
[SW1-Vlanif20]quit
[SW1]int vlanif 30
[SW1-Vlanif30]dhcp
[SW1-Vlanif30]dhcp select global
[SW1-Vlanif30]int vlanif40
[SW1-Vlanif40]dhcp select global
[SW1-Vlanif40]in vlanif50
[SW1-Vlanif50]dhcp select global
[SW1-Vlanif50]int vlanif 60
[SW1-Vlanif60]dhcp select global
查看DHCP pool状态
[SW1]display ip pool name 10 used
Pool-name : 10
Pool-No : 0
Lease : 1 Days 0 Hours 0 Minutes
Domain-name : -
DNS-server0 : 114.114.114.114
DNS-server1 : 8.8.8.8
NBNS-server0 : -
Netbios-type : -
Position : Local Status : Unlocked
Gateway-0 : 192.168.10.1
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable
-----------------------------------------------------------------------------
192.168.10.1 192.168.10.254 253 2 251(0) 0 0
-----------------------------------------------------------------------------
Network section :
--------------------------------------------------------------------------
Index IP MAC Lease Status
--------------------------------------------------------------------------
252 192.168.10.253 5489-98cb-6dea 1772 Used
253 192.168.10.254 5489-980b-17a0 1809 Used
--------------------------------------------------------------------------
[SW1]
核心交换机配置静态路由
[SW1]ip route-static 0.0.0.0 0 192.168.254.1
出口路由器配置静态路由
[R1]ip route-static 0.0.0.0 0 12.1.1.6 #指向运营商设备
出口路由配置回包静态路由
[R1]ip route-static 192.168.0.0 255.255.0.0 192.168.254.2
NAT配置
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[R1]int gi0/0/1
[R1-GigabitEthernet0/0/1]nat outbound 2000
查看NAT转换信息
[R1]display nat session all
NAT Session Table Information:
Protocol : ICMP(1)
SrcAddr Vpn : 192.168.10.254
DestAddr Vpn : 9.9.9.9
Type Code IcmpId : 0 8 62671
NAT-Info
New SrcAddr : 12.1.1.1
New DestAddr : ----
New IcmpId : 10251
Protocol : ICMP(1)
SrcAddr Vpn : 192.168.10.254
DestAddr Vpn : 9.9.9.9
Type Code IcmpId : 0 8 62672
NAT-Info
New SrcAddr : 12.1.1.1
New DestAddr : ----
New IcmpId : 10252
Protocol : ICMP(1)
SrcAddr Vpn : 192.168.10.254
DestAddr Vpn : 9.9.9.9
Type Code IcmpId : 0 8 62673
NAT-Info
New SrcAddr : 12.1.1.1
New DestAddr : ----
New IcmpId : 10253
Protocol : ICMP(1)
SrcAddr Vpn : 192.168.10.254
DestAddr Vpn : 9.9.9.9
Type Code IcmpId : 0 8 62674
NAT-Info
New SrcAddr : 12.1.1.1
New DestAddr : ----
New IcmpId : 10254
Total : 4
[R1]