1.创建VLAN,端口划分到对应VLAN
SW1(左)
vlan data
vlan 2
vlan 3
int f1/11
switchport mode access
switchport access vlan 2
int f1/12
switchport mode access
switchport access vlan 3
sh vlan-switch brief
2.创建动态DHCP pool
service dhcp
ip dhcp pool vlan20
network 20.1.1.0 255.255.255.0
default-router 20.1.1.254
dns-server 8.8.8.8
lease 1 2 3
ip dhcp excluded-address 20.1.1.1 20.1.1.10
ip dhcp excluded-address 20.1.1.254
ip dhcp pool vlan30
network 30.1.1.0 255.255.255.0
default-router 30.1.1.254
dns-server 8.8.8.8
lease 1 2 3
ip dhcp excluded-address 30.1.1.1 30.1.1.10
ip dhcp excluded-address 30.1.1.254
3.配置SVI口作为PC网关
SW1
int vlan 2
ip addr 20.1.1.254 255.255.255.0
int vlan 3
ip addr 30.1.1.254 255.255.255.0
4.SW1、SW2开启三辰接口
SW1:
int f1/1
no switchport
ip addr 12.1.1.1 255.255.255.0
no shut
ip routing
SW2:
int f1/2
no switchport
ip addr 12.1.1.2 255.255.255.0
no shut
ip routing
int f1/11
no switchport
ip addr 40.1.1.1 255.255.255.0
5.SW1建立静态地址池
ip dhcp pool pc3
host 40.1.1.2 255.255.255.0
client-identifier 01cc.080c.4800.00
default-router 40.1.1.1
dns-server 8.8.8.8
6.SW2配置中继
int f1/11
ip help-address 12.1.1.1
7.配置路由协议
SW1:
router rip
version 2
no auto-summary
net 12.0.0.0
net 20.0.0.0
net 30.0.0.0
SW2:
router rip
version 2
no auto-summary
net 12.0.0.0
net 40.0.0.0
8.查看
sh ip dhcp binding
9.PC端(路由器模拟)
no ip routing
ip addr dhcp
no shut
int f0/0
speed 100
duplex full
网友评论