PDA

View Full Version : Cấu hình multi DHCP server and relay agent.



trainingit
19-04-2008, 09:41 AM
- mô tả cấu hình Router hoạt động như DHCP server, gồm

+ 2 Router là DHCP server

DHCP01 : cấp IP cho vlan 2 : 192.168.2.0 (dải IP : 192.168.2.x, default-router, dns-server, netbios-nameserver 192.168.4.1)

DHCP02 : cấp IP cho vlan 3 : 192.168.3.0 (dải IP : 192.168.3.x, default-router, dns-server, netbios-nameserver 192.168.4.1)

+ switch L3 : DHCP relay agent

+ Gateway to ISP : 192.168.4.1

- mô hình:

http://img388.imageshack.us/img388/7449/multidhcpfs4.jpg

- cấu hình file .net


[localhost]

[[3640]]

#gateway
[[Router GW]]
model = 3640
image = D:\dynagenlabs\images\c3640-is-mz_120-7_t.bin
ram = 64
console = 2000
slot 0 = NM-1FE-TX
#idlepc =
f0/0 = SW 2

#dhcp server 1
[[Router DHCP01]]
model = 3640
image = D:\dynagenlabs\images\c3640-is-mz_120-7_t.bin
ram = 64
console = 2001
slot 0 = NM-1FE-TX
#idlepc =
f0/0 = SW 3

#dhcp server 2
[[Router DHCP02]]
model = 3640
image = D:\dynagenlabs\images\c3640-is-mz_120-7_t.bin
ram = 64
console = 2002
slot 0 = NM-1FE-TX
#idlepc =
f0/0 = SW 4

#ethernet switch
[[ETHSW SW]]
1 = access 1
2 = access 1
3 = access 1
4 = access 1

#switch L3
[[Router SWL3]]
model = 3640
image = D:\dynagenlabs\images\c3640-jk9o3s-mz.123-14.T7.extracted.bin
ram = 128
slot 0 = NM-16ESW
#idlepc =
fa0/0 = SW 1
#connect to Loopback adapter 01
fa0/3 = NIO_gen_eth:\Device\NPF_{E698101A-D8CD-4367-8AE2-7FD0468E543A}
#connect to Loopback adapter 02
fa0/4 = NIO_gen_eth:\Device\NPF_{AA0AE4B6-6BB2-4ABF-82DE-4D509F32E971}

(fa0/3 và fa0/4 connect với Microsoft Loopback Adapter trên PC)

- GW:
R1(config)#int f0/0
R1(config-if)#ip address 192.168.4.1 255.255.255.0
R1(config-if)#no shut

- DHCP01:
DHCP01(config)#int f0/0
DHCP01(config-if)#ip address 192.168.4.2 255.255.255.0
DHCP01(config-if)#no shut
DHCP01(config-if)#exit
DHCP01(config)#ip dhcp pool vlan2
DHCP01(dhcp-config)#network 192.168.2.0
DHCP01(dhcp-config)#default-router 192.168.4.1
DHCP01(dhcp-config)#dns-server 192.168.4.1
DHCP01(dhcp-config)#netbios-nameserver 192.168.4.1
DHCP01(dhcp-config)#domain testing.com
DHCP01(dhcp-config)#exit
DHCP01(config)#ip dhcp excluded-address 192.168.2.1
DHCP01(config)#ip dhcp excluded-address 192.168.2.201 192.168.2.254
DHCP01(config)#router rip
DHCP01(config-router)#network 192.168.4.0
DHCP01(config-router)#end

- DHCP02:
DHCP02(config)#int f0/0
DHCP02(config-if)#ip address 192.168.4.3 255.255.255.0
DHCP02(config-if)#no shut
DHCP02(config-if)#exit
DHCP02(config)#ip dhcp pool vlan3
DHCP02(dhcp-config)#network 192.168.3.0
DHCP02(dhcp-config)#default-router 192.168.4.1
DHCP02(dhcp-config)#dns-server 192.168.4.1
DHCP02(dhcp-config)#netbios-nameserver 192.168.4.1
DHCP02(dhcp-config)#domain testing.com
DHCP02(dhcp-config)#exit
DHCP02(config)#ip dhcp excluded-address 192.168.3.1
DHCP02(config)#ip dhcp excluded-address 192.168.3.201 192.168.3.254
DHCP02(config)#router rip
DHCP02(config-router)#network 192.168.4.0
DHCP02(config-router)#end

- SWL3:
SWL3#vlan database
SWL3(vlan)#vlan 2 name vlan02
SWL3(vlan)#vlan 3 name vlan03
SWL3(vlan)#exit
SWL3#conf t
SWL3(config)#int f0/0
SWL3(config-if)#no switchport
SWL3(config-if)#ip address 192.168.4.4 255.255.255.0
SWL3(config-if)#no shut
SWL3(config-if)#int fa0/3
SWL3(config-if)#switchport mode access
SWL3(config-if)#switchport access vlan 2
SWL3(config-if)#int fa0/4
SWL3(config-if)#switchport mode access
SWL3(config-if)#switchport access vlan 3
SWL3(config-if)#int vlan 2
SWL3(config-if)#ip address 192.168.2.1
SWL3(config-if)#ip helper-address 192.168.4.2
SWL3(config-if)#int vlan 3
SWL3(config-if)#ip address 192.168.3.1
SWL3(config-if)#ip helper-address 192.168.4.3
SWL3(config-if)#exit
SWL3(config)#ip routing
SWL3(config)#router rip
SWL3(config-router)#network 192.168.2.0
SWL3(config-router)#network 192.168.3.0
SWL3(config-router)#network 192.168.4.0
SWL3(config-router)#exit
#default route to Internet
SWL3(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.1
SWL3(config)#end

tranmyphuc
19-04-2008, 10:21 AM
- mô tả cấu hình Router hoạt động như DHCP server, gồm

+ 2 Router là DHCP server

DHCP01 : cấp IP cho vlan 2 : 192.168.2.0 (dải IP : 192.168.2.x, default-router, dns-server, netbios-nameserver 192.168.4.1)

DHCP02 : cấp IP cho vlan 3 : 192.168.3.0 (dải IP : 192.168.3.x, default-router, dns-server, netbios-nameserver 192.168.4.1)

+ switch L3 : DHCP relay agent

+ Gateway to ISP : 192.168.4.1

- mô hình:

http://img388.imageshack.us/img388/7449/multidhcpfs4.jpg

- cấu hình file .net



(fa0/3 và fa0/4 connect với Microsoft Loopback Adapter trên PC)

- GW:
R1(config)#int f0/0
R1(config-if)#ip address 192.168.4.1 255.255.255.0
R1(config-if)#no shut

- DHCP01:
DHCP01(config)#int f0/0
DHCP01(config-if)#ip address 192.168.4.2 255.255.255.0
DHCP01(config-if)#no shut
DHCP01(config-if)#exit
DHCP01(config)#ip dhcp pool vlan2
DHCP01(dhcp-config)#network 192.168.2.0
DHCP01(dhcp-config)#default-router 192.168.4.1
DHCP01(dhcp-config)#dns-server 192.168.4.1
DHCP01(dhcp-config)#netbios-nameserver 192.168.4.1
DHCP01(dhcp-config)#domain testing.com
DHCP01(dhcp-config)#exit
DHCP01(config)#ip dhcp excluded-address 192.168.2.1
DHCP01(config)#ip dhcp excluded-address 192.168.2.201 192.168.2.254
DHCP01(config)#router rip
DHCP01(config-router)#network 192.168.4.0
DHCP01(config-router)#end

- DHCP02:
DHCP02(config)#int f0/0
DHCP02(config-if)#ip address 192.168.4.3 255.255.255.0
DHCP02(config-if)#no shut
DHCP02(config-if)#exit
DHCP02(config)#ip dhcp pool vlan3
DHCP02(dhcp-config)#network 192.168.3.0
DHCP02(dhcp-config)#default-router 192.168.4.1
DHCP02(dhcp-config)#dns-server 192.168.4.1
DHCP02(dhcp-config)#netbios-nameserver 192.168.4.1
DHCP02(dhcp-config)#domain testing.com
DHCP02(dhcp-config)#exit
DHCP02(config)#ip dhcp excluded-address 192.168.3.1
DHCP02(config)#ip dhcp excluded-address 192.168.3.201 192.168.3.254
DHCP02(config)#router rip
DHCP02(config-router)#network 192.168.4.0
DHCP02(config-router)#end

- SWL3:
SWL3#vlan database
SWL3(vlan)#vlan 2 name vlan02
SWL3(vlan)#vlan 3 name vlan03
SWL3(vlan)#exit
SWL3#conf t
SWL3(config)#int f0/0
SWL3(config-if)#no switchport
SWL3(config-if)#ip address 192.168.4.4 255.255.255.0
SWL3(config-if)#no shut
SWL3(config-if)#int fa0/3
SWL3(config-if)#switchport mode access
SWL3(config-if)#switchport access vlan 2
SWL3(config-if)#int fa0/4
SWL3(config-if)#switchport mode access
SWL3(config-if)#switchport access vlan 3
SWL3(config-if)#int vlan 2
SWL3(config-if)#ip address 192.168.2.1
SWL3(config-if)#ip helper-address 192.168.4.2
SWL3(config-if)#int vlan 3
SWL3(config-if)#ip address 192.168.3.1
SWL3(config-if)#ip helper-address 192.168.4.3
SWL3(config-if)#exit
SWL3(config)#ip routing
SWL3(config)#router rip
SWL3(config-router)#network 192.168.2.0
SWL3(config-router)#network 192.168.3.0
SWL3(config-router)#network 192.168.4.0
SWL3(config-router)#exit
#default route to Internet
SWL3(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.1
SWL3(config)#end

Chào !!!
Xin bổ sung một điểm các bạn hay quên:

SWL3(config-if)#int vlan 2
SWL3(config-if)#no shut
SWL3(config-if)#ip address 192.168.2.1
SWL3(config-if)#ip helper-address 192.168.4.2

Chúc các bạn vui !!!

trainingit
19-04-2008, 10:58 AM
- cái này là lúc cấu hình

SWL3(config)#int vlan 2

vlan 2, 3 đã tự động up lên khi gán switchport access vlan 2 , switchporrt access vlan 3

=> vì vậy nên ko cần no shut để up lên nữa :D

tranmyphuc
19-04-2008, 11:52 AM
- cái này là lúc cấu hình

SWL3(config)#int vlan 2

vlan 2, 3 đã tự động up lên khi gán switchport access vlan 2 , switchporrt access vlan 3

=> vì vậy nên ko cần no shut để up lên nữa :D
chào !!!
Xem tại đây :
http://www.vnpro.org/forum/showthread.php?t=15399

Chúc anh vui !!!

trainingit
19-04-2008, 12:22 PM
chào !!!
Xem tại đây :
http://www.vnpro.org/forum/showthread.php?t=15399

Chúc anh vui !!!

hi,

- thực ra đây là lỗi cơ bản thôi, đã đến lab CCNP rồi thì ko khó để sửa được lỗi shut, hay no shut :D

- ở đây là mình dùng lab dynagen, interface nó đã up sẵn lên rồi, nên mình ko gõ lệnh đó vào cấu hình nữa, nếu trong lab với switch thật mà interface ko tự up lên, thì chỉ cần thêm no shut vào là OK.

- chỉ cần show interface vlan vlan-id là biết liền, nếu thấy báo administrative down, or line protocol down thì có thể biết ngay lỗi là ở layer 1, hay layer 2,

- nếu down ở layer 1 thì no shut

- nếu down ở layer 2 thì ...

=> nói chung lỗi interface ko up là lỗi ko khó sửa, chỉ có lỗi ở 2 layer dưới cùng thôi, nếu ko sửa được thì phải quay lại học lab CCNA mất :D

tranmyphuc
19-04-2008, 03:30 PM
hi,

- thực ra đây là lỗi cơ bản thôi, đã đến lab CCNP rồi thì ko khó để sửa được lỗi shut, hay no shut :D

- ở đây là mình dùng lab dynagen, interface nó đã up sẵn lên rồi, nên mình ko gõ lệnh đó vào cấu hình nữa, nếu trong lab với switch thật mà interface ko tự up lên, thì chỉ cần thêm no shut vào là OK.

- chỉ cần show interface vlan vlan-id là biết liền, nếu thấy báo administrative down, or line protocol down thì có thể biết ngay lỗi là ở layer 1, hay layer 2,

- nếu down ở layer 1 thì no shut

- nếu down ở layer 2 thì ...

=> nói chung lỗi interface ko up là lỗi ko khó sửa, chỉ có lỗi ở 2 layer dưới cùng thôi, nếu ko sửa được thì phải quay lại học lab CCNA mất :D

Chào !!!
Thực chất có thể nói bài LAB này là trình độ CCNA nhưng những ai học theo giáo trình academy mới phải học nâng cao như vậy.
Ngoài ra ở CCNA academy còn học cả chứng thực OSPF... những phần từ trước đến giờ nhiều người thấy nó vẫn nằm tại giáo trình ccnp

Thay mặt mọi người , cảm ơn anh về bài LAB rất chi tiết và hay này. chắc chắn nó sẽ là một học liệu quý giúp cho mọi người có thể ứng dụng nó vào mạng doanh nghiệp để cấu hình một mạng tối ưu hơn
Chúc anh luôn khỏe
Chúc anh vui !!!