2013/05/24

Cisco Packet Tracer 設定Router DHCP

 Packet Tracer 是最近在上網路工程所用的一套模擬軟體,這套模擬軟體應該跟Cisco真實設定相去不遠

我的網路架構是由一個Router、一個Switch和三台電腦所組成的







剛開啟時會詢問是否要進行設定,當然要進行設定,不然之後要怎麼用呢?

System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)
Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.

Self decompressing the image :
########################################################################## [OK]
              Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706



Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 04:52 by pt_team
Image text-base: 0x60080608, data-base: 0x6270CD50


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.


Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.
Processor board ID FTX0947Z18E
M860 processor: part number 0, mask 49
2 FastEthernet/IEEE 802.3 interface(s)
191K bytes of NVRAM.
63488K bytes of ATA CompactFlash (Read/Write)
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 04:52 by pt_team


         --- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: yes


接著會詢問你的Host Name
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.


Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system

Would you like to enter basic management setup? [yes/no]: yes
Configuring global parameters:

  Enter host name [Router]: MyRouter



接著當然要更改Terminal的密碼,初始密碼是cisco
The enable secret is a password used to protect access to
privileged EXEC and configuration modes. This password, after
entered, becomes encrypted in the configuration.
Enter enable secret: cisco

The enable password is used when you do not specify an
enable secret password, with some older software versions, and
some boot images.
Enter enable password: 12345

The virtual terminal password is used to protect
access to the router over a network interface.
Enter virtual terminal password: 12345
Configure SNMP Network Management? [no]:no


安裝的差不多時會出現目前網卡的組態檔,就看使用者要不要去設定

Current interface summary

Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES manual administratively down down

FastEthernet0/1        unassigned      YES manual administratively down down

Vlan1                  unassigned      YES manual administratively down down

Enter interface name used to connect to the
management network from the above interface summary: FastEthernet0/0

Configuring interface FastEthernet0/0:
Configure IP on this interface? [yes]: yes
IP address for this interface: 192.168.1.1
Subnet mask for this interface [255.255.255.0] : 


設定完成會出現以下這些文字

The following configuration command script was created:

!
hostname MyRouter
enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
enable password 12345
line vty 0 4
password 12345
!
interface Vlan1
 shutdown
 no ip address
!
interface FastEthernet0/0
 no shutdown
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/1
 shutdown
 no ip address
!
end

[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.

Enter your selection [2]: 2
Building configuration...

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

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

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINK-5-CHANGED: Interface Vlan1, changed state to administratively down

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%SYS-5-CONFIG_I: Configured from console by console
[OK]
Use the enabled mode 'configure' command to modify this configuration.


Press RETURN to get started!


接著在下以下指令,將Router設定成DHCP去分配
MyRouter>enable
Password: 
MyRouter#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
MyRouter(config)#ip dhcp pool IPD
MyRouter(dhcp-config)#network 192.168.1.0 255.255.255.0
MyRouter(dhcp-config)#default-router 192.168.1.1
MyRouter(dhcp-config)#exit
MyRouter(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.15

將每台Host的Setting由Static改成DHCP,不然到時候沒辦法取得IP




接著Host就會自動取得IP位址了,但是這邊分配IP是從16之後開始,因為
#ip dhcp excluded-address 192.168.1.1 192.168.1.15
是將IP排除在外,在那之後的IP才可以使用








參考資料:
http://ipcisco.com/router-dhcp-configuration-with-packet-tracer/