单臂路由和DHCP集成实验

网络拓扑图:

单臂路由和DHCP集成

路由器配置:

Current configuration : 1351 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip dhcp excluded-address 192.168.20.1
ip dhcp excluded-address 192.168.20.2
ip dhcp excluded-address 192.168.20.4
ip dhcp excluded-address 192.168.20.3
ip dhcp excluded-address 192.168.30.1
ip dhcp excluded-address 192.168.30.2
ip dhcp excluded-address 192.168.30.3
ip dhcp excluded-address 192.168.30.4
!
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 202.96.134.133
ip dhcp pool vlan30
network 192.168.30.0 255.255.255.0
default-router 192.168.30.1
dns-server 202.96.134.133
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 20
ip address 192.168.30.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 30
ip address 192.168.20.1 255.255.255.0
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
shutdown
!
interface Serial2/0
no ip address
clock rate 2000000
shutdown
!
interface Serial3/0
no ip address
clock rate 2000000
shutdown
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
no ip address
shutdown
!
ip classless
!
line con 0
line vty 0 4
login
!
end
交换机配置:
Current configuration : 1260 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/4
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 30
switchport mode access
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
实现效果:PC0,PC1自动从路由器获得VLAN 30网段的IP地址;PC2,PC3自动从路由器获得VLAN 20网段的IP地址。

PC0

PC1

PC2

PC3

你可能感兴趣的:(网络,border,Alt,target,blank)