实验:VLAN环境下DHCP的配置
2008-11-16 13:46
736 查看
虚拟情景:
企业有多个部门,这些部门的主机都连接在一台多接口交换机上,不同的部门分别被划分在不同的VLAN中,为了尽快部署,要求使用DHCP对这些属于不同VLAN的主机进行IP地址分配。
实验拓扑如下:
配置步骤概述:
1.在交换机上创建VLAN。在该实验中我们创建了VLAN 10,20,30。
2.在将换机上将连接不同部门的端口分配到所属的VLAN上。如上图示。
3.将交换机与路由器相连的端口配置为TRUNK模式。默认的封装模式为802.1Q。
4.在路由器上的F0/0配置子接口,并将子接口封装在特定的VLAN中。
5.在用户主机上启用“自动获取IP地址”
具体配置如下:
一、交换机上的配置:
Switch#sh run
Building configuration...
Current configuration : 967 bytes
!
version 12.1
no service password-encryption
!
hostname Switch
!
!
!
interface FastEthernet0/1
switchport access vlan 10
!
interface FastEthernet0/2
switchport access vlan 20
!
interface FastEthernet0/3
switchport access vlan 30
!
...略
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
二、在路由器上的配置:
Router#sh run
Building configuration...
Current configuration : 772 bytes
!
version 12.2
no service password-encryption
!
hostname Router
!
!
!
!
!
ip ssh version 1
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 30
ip address 192.168.30.254 255.255.255.0
!
ip classless
!
!
!
!
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
ip dhcp pool vlan30
network 192.168.30.0 255.255.255.0
default-router 192.168.30.254
!
line con 0
line vty 0 4
login
!
!
end
三、在主机上启用“自动获取IP”
PC0
PC1
PC2
好了,实验结束了。希望能用得着。
企业有多个部门,这些部门的主机都连接在一台多接口交换机上,不同的部门分别被划分在不同的VLAN中,为了尽快部署,要求使用DHCP对这些属于不同VLAN的主机进行IP地址分配。
实验拓扑如下:
配置步骤概述:
1.在交换机上创建VLAN。在该实验中我们创建了VLAN 10,20,30。
2.在将换机上将连接不同部门的端口分配到所属的VLAN上。如上图示。
3.将交换机与路由器相连的端口配置为TRUNK模式。默认的封装模式为802.1Q。
4.在路由器上的F0/0配置子接口,并将子接口封装在特定的VLAN中。
5.在用户主机上启用“自动获取IP地址”
具体配置如下:
一、交换机上的配置:
Switch#sh run
Building configuration...
Current configuration : 967 bytes
!
version 12.1
no service password-encryption
!
hostname Switch
!
!
!
interface FastEthernet0/1
switchport access vlan 10
!
interface FastEthernet0/2
switchport access vlan 20
!
interface FastEthernet0/3
switchport access vlan 30
!
...略
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
二、在路由器上的配置:
Router#sh run
Building configuration...
Current configuration : 772 bytes
!
version 12.2
no service password-encryption
!
hostname Router
!
!
!
!
!
ip ssh version 1
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 30
ip address 192.168.30.254 255.255.255.0
!
ip classless
!
!
!
!
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
ip dhcp pool vlan30
network 192.168.30.0 255.255.255.0
default-router 192.168.30.254
!
line con 0
line vty 0 4
login
!
!
end
三、在主机上启用“自动获取IP”
PC0
PC1
PC2
好了,实验结束了。希望能用得着。
相关文章推荐
- 路由交换笔记(28)--ACL-NAT-VLAN-DHCP综合实验配置
- ENSP环境中不同vlan实现DHCP功能以及DHCP中继的配置
- ACL-NAT-VLAN-DHCP综合实验配置
- 初级网络实验1:单VLAN的DHCP配置(明天会做多VLAN的DHCP)
- 通过思科模拟器配置多个vlan,dhcp,vtp等综合实验
- VLAN间通信并以太网通道同时配置DHCP服务【笔记|实验】
- 路由交换笔记(28)--ACL-NAT-VLAN-DHCP综合实验配置
- 初级网络实验2:多VLAN的DHCP配置
- 如何在三层交换机上实现跨VLAN的DHCP配置
- Puppet 实验六 多环境配置
- 实验一 Linux开发环境的配置 20145213祁玮 20145222黄亚奇
- CCNA之旅-交换机的基本配置-stp、vtp、vlan间通信实验
- 实验环境安装及配置(四)——向vCenter中添加ESXI主机
- Packet Tracer 5.0建构CCNA实验攻略(16)――DHCP 中继配置
- 77、VLAN间路由配置实验之SVI
- Cisco3750在多VLAN网络环境下DHCP的实现
- 实验五 交换机划分Vlan配置
- 华为路由器qos car+nat+dhcp+vlan配置心得 推荐
- 信息安全系统设计基础实验一:Linux开发环境的配置和使用(135317、135337)
- DHCP中继各种组网环境配置