1. 程式人生 > >思科三層交換DHCP基本配置

思科三層交換DHCP基本配置

dy

實驗拓撲圖

一臺三層交換機和四臺Server

技術分享

DHCP的基本配置

DHCP#

DHCP#VLAN DAtabase

DHCP(vlan)#vlan 10

VLAN 10 added:

Name: VLAN0010

DHCP(vlan)#vlan 20

VLAN 20 added:

Name: VLAN0020

DHCP(vlan)#vlan 30

VLAN 30 added:

Name: VLAN0030

DHCP(vlan)#vlan 40

VLAN 40 added:

Name: VLAN0040

DHCP(vlan)#exit

APPLY completed.

Exiting....

DHCP#conf t

Enter configuration commands, one per line. End with CNTL/Z.

DHCP(config)#ip routing

DHCP(config)#int f0/1

DHCP(config-if)#switchport access vlan 10

DHCP(config-if)#int f0/2

DHCP(config-if)#switchport access vlan 20

DHCP(config-if)#int f0/3

DHCP(config-if)#switchport access vlan 30

DHCP(config-if)#int f0/4

DHCP(config-if)#switchport access vlan 40

DHCP(config-if)#exit

DHCP(config)#int vlan 10

DHCP(config-if)#ip address 10.0.0.10 255.0.0.0

DHCP(config-if)#no sh

DHCP(config-if)#int vlan 20

DHCP(config-if)#ip address 20.0.0.10 255.0.0.0

DHCP(config-if)#no sh

DHCP(config-if)#int vlan 30

DHCP(config-if)#ip address 30.0.0.10 255.0.0.0

DHCP(config-if)#no sh

DHCP(config-if)#int vlan 40

DHCP(config-if)#ip address 40.0.0.10 255.0.0.0

DHCP(config-if)#no sh

DHCP(config-if)#exit

DHCP(config)#ip dhcp pool v1

DHCP(dhcp-config)#network 10.0.0.0

DHCP(dhcp-config)#default-router 10.0.0.10

DHCP(dhcp-config)#dns-server 202.106.0.20

DHCP(dhcp-config)#lease 3

DHCP(dhcp-config)#exit

DHCP(config)#ip dhcp excluded-address 10.0.0.1 10.0.0.20

DHCP(config)#ip dhcp pool v2

DHCP(dhcp-config)#network 20.0.0.0

DHCP(dhcp-config)#default-router 20.0.0.10

DHCP(dhcp-config)#dns

DHCP(dhcp-config)#dns-server 202.106.0.20

DHCP(dhcp-config)#le

DHCP(dhcp-config)#lease 3

DHCP(dhcp-config)#exit

DHCP(config)#ip dhcp excluded-address 20.0.0.1 20.0.0.20

DHCP(config)#ip dhcp pool v3

DHCP(dhcp-config)#network 30.0.0.0

DHCP(dhcp-config)#default-router 30.0.0.10

DHCP(dhcp-config)#dns-server 202.106.0.20

DHCP(dhcp-config)#lease 3

DHCP(dhcp-config)#exit

DHCP(config)#ip dhcp excluded-address 30.0.0.1 30.0.0.20

DHCP(config)#ip dhcp pool v4

DHCP(dhcp-config)#network 40.0.0.0

DHCP(dhcp-config)#default-router 40.0.0.10

DHCP(dhcp-config)#dns-server 202.106.0.20

DHCP(dhcp-config)#lease 3

DHCP(dhcp-config)#exit

DHCP(config)#ip dhcp excluded-address 40.0.0.1 40.0.0.20

DHCP(config)#exit

DHCP#sh ip int br

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES unset up down

FastEthernet0/1 unassigned YES unset up up

FastEthernet0/2 unassigned YES unset up up

FastEthernet0/3 unassigned YES unset up up

FastEthernet0/4 unassigned YES unset up up

FastEthernet0/5 unassigned YES unset up down

FastEthernet0/6 unassigned YES unset up down

FastEthernet0/7 unassigned YES unset up down

FastEthernet0/8 unassigned YES unset up down

FastEthernet0/9 unassigned YES unset up down

FastEthernet0/10 unassigned YES unset up down

FastEthernet0/11 unassigned YES unset up down

FastEthernet0/12 unassigned YES unset up down

FastEthernet0/13 unassigned YES unset up down

FastEthernet0/14 unassigned YES unset up down

FastEthernet0/15 unassigned YES unset up down

FastEthernet1/0 unassigned YES unset administratively down down

Vlan1 unassigned YES unset up down

Vlan10 10.0.0.10 YES manual up up

Vlan20 20.0.0.10 YES manual up up

Vlan30 30.0.0.10 YES manual up up

Vlan40 40.0.0.10 YES manual up up

DHCP#sh ip route

DHCP#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


20.0.0.0/24 is subnetted, 1 subnets

C 20.0.0.0 is directly connected, Vlan20

40.0.0.0/24 is subnetted, 1 subnets

C 40.0.0.0 is directly connected, Vlan40

10.0.0.0/24 is subnetted, 1 subnets

C 10.0.0.0 is directly connected, Vlan10

30.0.0.0/24 is subnetted, 1 subnets

C 30.0.0.0 is directly connected, Vlan30

DHCP#sh vlan-s


VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/0, Fa0/5, Fa0/6, Fa0/7

Fa0/8, Fa0/9, Fa0/10, Fa0/11

Fa0/12, Fa0/13, Fa0/14, Fa0/15

10 VLAN0010 active Fa0/1

20 VLAN0020 active Fa0/2

30 VLAN0030 active Fa0/3

40 VLAN0040 active Fa0/4

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active


VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 1002 1003

10 enet 100010 1500 - - - - - 0 0

20 enet 100020 1500 - - - - - 0 0

30 enet 100030 1500 - - - - - 0 0

40 enet 100040 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 1 1003

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1003 tr 101003 1500 1005 0 - - srb 1 1002

1004 fdnet 101004 1500 - - 1 ibm - 0 0

1005 trnet 101005 1500 - - 1 ibm - 0 0

DHCP#

配置完成驗證最後一臺Server,

技術分享

其他不一一驗證了

本文出自 “DY” 博客,請務必保留此出處http://guochenyong.blog.51cto.com/11367898/1980045

思科三層交換DHCP基本配置