- 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:
- 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
+ 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:
- 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}
[[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}
- 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
Comment