单臂路由+DHCP实验

拓扑图:

SW1、SW2:

en
conf t
vlan 10
name a
vlan 20
name b
int f0/1
switchport mode access 
switchport access vlan 10
int f0/2
switchport mode access 
switchport access vlan 20
int f0/3
switchport mode trunk 
switchport trunk allowed vlan all 
exit

SW0:

en
conf t
vlan 10
name a
vlan 20
name b
int range f0/1 - 3
switchport mode trunk
switchport trunk allowed vlan all
exit

R0:

en
conf t
int f0/0
no shut
int f0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
no shut
int f0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
no shut
exit

ip dhcp pool a-pool//定义IP地址池:a-pool
network 192.168.10.0 255.255.255.0//动态分配IP地址段
default-router 192.168.10.254//设定网关地址
dns-server 114.114.114.114//配置DNS地址
exit
//预留IP地址
ip dhcp excluded-address 192.168.10.1 192.168.10.10
ip dhcp excluded-address 192.168.10.254

ip dhcp pool b-pool
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 8.8.8.8
exit
ip dhcp excluded-address 192.168.20.1 192.168.20.10
ip dhcp excluded-address 192.168.20.254

PC0、PC1、PC2、PC3:

IP Configuration选择:DHCP

相互之间均能ping通!

R0:

int f0/1
ip address 202.100.10.1 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 202.100.10.2

R1:

en
conf t
int f0/0
ip address 202.100.10.2 255.255.255.0
no shut
int f0/1
ip address 202.100.20.1 255.255.255.0
no shut
exit
ip route 192.168.10.0 255.255.255.0 202.100.10.1
ip route 192.168.20.0 255.255.255.0 202.100.10.1

PC4:

IP:202.100.20.2

Gateway:202.100.20.1

PC4 ping PC0、PC1、PC2、PC3 通!

PC0、PC1、PC2、PC3 ping PC4 通!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值