配置dhcp的命令和步骤

DHCP的配置命令,今天小编就来说说关于配置dhcp的命令和步骤?下面更多详细答案一起来看看吧!

配置dhcp的命令和步骤

配置dhcp的命令和步骤

DHCP

的配置命令

第一步:配置各个

vlan

所用的地址池和相应参数

1

)配置

VLAN2

所用的地址池和相应参数

Switch(config)#ipdhcppooltest2

Switch(dhcp-config)#network192.168.3.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.3.1

2

)配置

VLAN3

所用的地址池和相应参数

Switch(config)#ipdhcppooltest3

Switch(dhcp-config)#network192.168.4.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.4.1

3

)配置

VLAN4

所用的地址池和相应参数

Switch(config)#ipdhcppooltest4

Switch(dhcp-config)#network192.168.5.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.5.1

4

)配置

VLAN5

所用的地址池和相应参数

Switch(config)#ipdhcppooltest5

Switch(dhcp-config)#network192.168.6.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.6.1

5

)配置

VLAN6

所用的地址池和相应参数

Switch(config)#ipdhcppooltest6

Switch(dhcp-config)#network192.168.7.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.7.1

6

)配置

VLAN7

所用的地址池和相应参数

Switch(config)#ipdhcppooltest7

Switch(dhcp-config)#network192.168.8.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.8.1

7

)配置

VLAN8

所用的地址池和相应参数

Switch(config)#ipdhcppooltest8

Switch(dhcp-config)#network192.168.9.0255.255.255.0

Switch(dhcp-config)#dns-server192.168.2.30

Switch(dhcp-config)#default-router192.168.9.1

第二步:设置

DHCP

保留不分配的地址

Switch(config)#ipdhcpexcluded-address192.168.3.2192.168.3.10

Switch(config)#ipdhcpexcluded-address192.168.4.2192.168.4.10

Switch(config)#ipdhcpexcluded-address192.168.5.2192.168.5.10

Switch(config)#ipdhcpexcluded-address192.168.6.2192.168.6.10

Switch(config)#ipdhcpexcluded-address192.168.7.2192.168.7.10

Switch(config)#ipdhcpexcluded-address192.168.8.2192.168.8.10

Switch(config)#ipdhcpexcluded-address192.168.9.2192.168.9.10

第三步:启动路由:

(路由启动后,各

VLAN

间主机可互相访问)

Switch(config)#iprouting

第四步:配置访问控制列表

Switch(config)#access-list1permit192.168.3.00.0.0.255

Switch(config)#access-list2permit192.168.4.00.0.0.255

Switch(config)#access-list3permit192.168.5.00.0.0.255

Switch(config)#access-list4permit192.168.6.00.0.0.255

Switch(config)#access-list5permit192.168.7.00.0.0.255

Switch(config)#access-list6permit192.168.8.00.0.0.255

Switch(config)#access-list7permit192.168.9.00.0.0.255

第五步:应用访问控制列表:

(

将访问控制列表应用到各个

VLAN

)

Switch(config)#intvlan2

Switch(config-vlan)#ipaccess-group1out

Switch(config)#intvlan3

Switch(config-vlan)#ipaccess-group2out

Switch(config)#intvlan4

Switch(config-vlan)#ipaccess-group3out

Switch(config)#intvlan5

Switch(config-vlan)#ipaccess-group4out

Switch(config)#intvlan6

Switch(config-vlan)#ipaccess-group5out

Switch(config)#intvlan7

Switch(config-vlan)#ipaccess-group6out

Switch(config)#intvlan8

Switch(config-vlan)#ipaccess-group7out

第六步:结束并保存配置

Switch(config-vlan)#end

Switch#copyrunstart

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页