Host A DHCPDISCOVER(broadcast) Cisco IOS
DHCP server
DHCPOFFER(unicast)
DHCPREQUEST(broadcast)
DHCPACK(unicast)
101
DHCP Guideline
Router(config)# int Fa0/0 .
Router(config)# ip address 192.168. . 255.255.255.0
Router(config-if)# no shut
Router(config-if)# exit
Router(config)# ip dhcp excluded-address 192.168. . 192.168.
Router(config)# ip dhcp pool LAN-1
Router(dhcp-config)# network 192.168. . 255.255.255.0
Router(dhcp-config)# domain-name ccna.com
Router(dhcp-config)# dns-server 192.168. . 192.168. .
Router(dhcp-config)# default-router 192.168. .
Router(dhcp-config)# lease 4 3 30
Router(dhcp-config)# end
Router# copy run start
ทาการทดสอบโดยใช้คาสงั่ ipconfig /all ท่ีเครื่อง Host 102
DHCP Helper Guide
Scope1: 192.168.1.x/24 Switch1 Router Switch2
Scope2: 192.168.2.x/24
Fa0/0 Fa0/1
DHCP Server
192.168.1.1/24 192.168.1.254/24 192.168.2.254/24
LAN1: 192.168.1.0/24 LAN2: 192.168.2.0/24
DHCP Client1 DHCP Client2
Router(config)# int fa0/1 103
Router(config-if)# ip helper-address 192.168.1.1
Note:
104
Part 5: NAT
• Lab situation
-This room allow only subnet address
203.10.1.0/24 to reach the internet. We will
change ip address of Fa0/0 of router HQ to
203.10.1.1
- You task is to allow PC connecting to router
Branch1 & Branch2 to access the internet by
configuring NAT on router HQ to translate source
address from 192.168.2.xx & 192.168.3.xx to
203.10.1.xx
105
Part 5 : Guide (NAT)
• HQ
HQ(config)# int Fa0/0
HQ(config-if)# ip address 203.10.1.1 255.255.255.0
HQ(config-if)# ip nat outside
HQ(config-if)# int S0/0
HQ(config-if)# ip nat inside
HQ(config-if)# int S0/1
HQ(config-if)# ip nat inside
HQ(config-if)# exit
HQ(config)# access-list 10 permit 192.168.2.0 0.0.0.255
HQ(config)# access-list 10 permit 192.168.3.0 0.0.0.255
106
Part 5 : Guide (cont.)
• Method 1 : use PAT (NAT Overloading)
- HQ(config)# ip nat inside source list 10 interface Fa0/0 overload
--------------------------------------------------------------------------
• Method 2 : use Dynamic + Overloading NAT
-HQ(config)# ip nat pool MYPOOL 203.10.1.2 203.10.1.9
netmask 255.255.255.0
-HQ(config)# ip nat inside source list 10 pool MYPOOL overload
---------------------------------------------------------------------------
• Method 3 : use Static NAT
- HQ(config)# ip nat insde source static 192.168.2.100 203.10.1.10
- HQ(config)# ip nat insde source static 192.168.3.100 203.10.1.11
**Before trying to use another method, you have to use
command “clear ip nat translation*”
107
Part 5 : Guide (cont.)
• Method 4 : use Static NAT with Port Forwarder
- HQ(config)# ip nat inside source static tcp 192.168.2.100 23
interface Fa0/0 23
- HQ(config)# ip nat inside source static tcp 192.168.3.100 80
interface Fa0/0 80
108