티스토리 뷰

Setting router DHCP in packet tracer


1. Set IP address

1-1. Check it

2. Set DHCP at router

2-1. Check it

3. Set DHCP at PC

3-1. Check it

4. Conclusion



1. Set IP address


For demonstration, put a router, switch and three PC.


Set a IP address for network.


Than type

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface FastEthernet 0/0
Router(config-if)#ip address 192.168.0.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#exit

Long code version


Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#in f 0/0
Router(config-if)#i ad 192.168.0.1 255.255.255.0
Router(config-if)#n sh

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#e
Router(config)#ex
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#ex

Short code version (Extreme)


Both code function exactly same way in this scenario



1-1. Check it


After this you can check it with CLI or GUI like this.

IP address is 192.168.0.1 and Subnet Mask is 255.255.255.0 (/24)


GUI version

Click config tab and click FastEthernet0/0 (or interface you connected)


CLI version 

Type show show running-config or sh r

Router>enable
Router#show running-config
Building configuration...

Current configuration : 740 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.0.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial2/0
 no ip address
 clock rate 2000000
 shutdown
!
interface Serial3/0
 no ip address
 clock rate 2000000
 shutdown
!
interface FastEthernet4/0
 no ip address
 shutdown
!
interface FastEthernet5/0
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end



2. Set DHCP at router


Go to router and type command like this.

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip dhcp pool last72
Router(dhcp-config)#network 192.168.0.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.0.1
Router(dhcp-config)#exit
Router(config)#exit
Router#

Replace last72 to name of pool you want to name. (Line 4)

Put network id and subnet mask of your desired network (Line 5)

Put gateway address of network (Line 6)


2-1. Check it


Type 

show running-config in CLI

Router>enable
Router#show running-config
Building configuration...

Current configuration : 783 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
ip dhcp pool last72
 network 192.168.0.0 255.255.255.0
 default-router 192.168.0.1
!
!
!
no ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.0.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial2/0
 no ip address
 shutdown
!
interface Serial3/0
 no ip address
 shutdown
!
interface FastEthernet4/0
 no ip address
 shutdown
!
interface FastEthernet5/0
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end


DHCP setting can be check in line 18 to line 20



3. Set DHCP at PC

To finish this setting, PC need to be configured.

In command prompt mode, type ipconfig /renew

C:\>ipconfig /renew

   IP Address......................: 192.168.0.2
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.0.1
   DNS Server......................: 0.0.0.0


Or in Desktop tab, click IP Configuration.


Change Static to DHCP, after a while, an IP address will be assigned with message at the top right saying DHCP request successful.


Do same configuration for other 2 PC as well.



3-1. Check it

Type ipconfig at command prompt (cmd)

Packet Tracer PC Command Line 1.0
C:\>ipconfig

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::204:9AFF:FEB0:9CD1
   IP Address......................: 0.0.0.0
   Subnet Mask.....................: 0.0.0.0
   Default Gateway.................: 0.0.0.0

C:\>ipconfig /renew

   IP Address......................: 192.168.0.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.0.1
   DNS Server......................: 0.0.0.0

C:\>ipconfig

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::204:9AFF:FEB0:9CD1
   IP Address......................: 192.168.0.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.0.1

C:\>

Before set DHCP (line 6 to line 9), there is no IP address

But after set DHCP (line 11 to line 16), PC got an IP address (line 22 to line 25)


Or you can put your mouse over the PC icon in packet tracer to see details including IP address.


Finally, by ping each other we can check the connection

Click the Add Simple PDU on the right tab.


Click one PC that will send ping and click another PC to receive the ping.


After that, you need to click the arrow button on bottom right. So that you can see the result.


4. Conclusion

Simple DHCP setting. Final look can be look like this. Otherwise you can look my demo file. 

Last72_Router_DHCP.pkt

End




'AU Study > TAFE' 카테고리의 다른 글

How to download Windows Server 2016  (0) 2018.02.08
Router Rip setting in packet tracer  (0) 2017.12.03
w16 wed morning  (0) 2017.11.16
w16 tue morning  (0) 2017.11.16
w15 tue morning  (0) 2017.11.16
댓글
Announcement
Recent Posts
Recent Comments
Total
Today
Yesterday
Link
TAG
more
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Search by month