DHCP中继实验

 实验要求:

  1. SW2和SW3为二层交换机,SW1为三层交换机。
  2. R1和SW2这部分使用单臂路由技术。
  3. SW1和SW3这部分使用VLAN间路由。
  4. 网段和VLAN规划如上图所示,其中vlan10和vlan20所属网段网关配置在R1上,vlan30和vlan40所属网段配置在SW1上,全网路由使用静态路由配置。
  5. PC1绑定IP地址192.168.1.100,PC2不能获取192.168.2.200~192.168.2.254之间的地址
  6. 全网所有主机IP地址采用自动获取, R2作为vlan10、vlan20、VLAN30、VLAN40的DHCP服务器,最终实现所有用户主机都能互相通信。

命令:

路由器1:

[r1]int e0/0/1
[r1-Ethernet0/0/1]ip address 192.168.12.1 30
[r1-Ethernet0/0/1]int e0/0/0.10
[r1-Ethernet0/0/0.10]ip address 192.168.1.1 24
[r1-Ethernet0/0/0.10]dot1q termination vid 10
[r1-Ethernet0/0/0.10]arp broadcast en
[r1-Ethernet0/0/0.10]int e0/0/0.20
[r1-Ethernet0/0/0.20]ip address 192.168.2.1 24
[r1-Ethernet0/0/0.20]dot1q termination vid 20
[r1-Ethernet0/0/0.20]arp broadcast en
[r1-Ethernet0/0/0.20]q
[r1]rip
[r1-rip-1]version 2
[r1-rip-1]undo summary
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.2.0
[r1-rip-1]network 192.168.12.0
[r1-rip-1]q
[r1]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]int e0/0/0.10  
[r1-Ethernet0/0/0.10]dhcp relay  server-ip 192.168.12.1 
[r1-Ethernet0/0/0.10]int e0/0/0.20
[r1-Ethernet0/0/0.20]dhcp relay server-ip 192.168.12.1

 路由器2:

[r2]int e0/0/0
[r2-Ethernet0/0/0]ip address 192.168.12.2 30
[r2-Ethernet0/0/0]int e0/0/1 
[r2-Ethernet0/0/1]ip address 192.168.12.5 30
[r2-Ethernet0/0/1]q
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]undo summary
[r2-rip-1]network 192.168.12.0
[r2-rip-1]q
[r2]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[r2]ip pool 10
Info:It's successful to create an IP address pool.
[r2-ip-pool-10]network 192.168.1.0 mask 24
[r2-ip-pool-10]gateway-list 192.168.1.1
[r2-ip-pool-10]dns-list 8.8.8.8
[r2-ip-pool-10]ip pool 20
Info:It's successful to create an IP address pool.
[r2-ip-pool-20]network 192.168.2.0 mask 24
[r2-ip-pool-20]gateway-list 192.168.2.1
[r2-ip-pool-20]dns-list 8.8.8.8
[r2-ip-pool-20]ip pool 30
Info:It's successful to create an IP address pool.
[r2-ip-pool-30]gateway-list 192.168.3.1
[r2-ip-pool-30]network 192.168.3.0 mask 24
[r2-ip-pool-30]dns-list 8.8.8.8
[r2-ip-pool-30]ip pool 40
Info:It's successful to create an IP address pool.
[r2-ip-pool-40]network 192.168.4.0 mask 24
[r2-ip-pool-40]gateway-list 192.168.4.1
[r2-ip-pool-40]dns-list 8.8.8.8
[r2-ip-pool-40]q
[r2]int e0/0/0
[r2-Ethernet0/0/0]dhcp select global 
[r2-Ethernet0/0/0]int e0/0/1
[r2-Ethernet0/0/1]dhcp select global 
[r2]ip pool 10
[r2-ip-pool-10]static-bind ip-address 192.168.1.100 mac-address 5489-981D-292
8(这个双击pc机查看MAC地址)
[r2-ip-pool-10]ip pool 20
[r2-ip-pool-20]excluded-ip-address 192.168.2.200 192.168.2.254

交换机1:

[s1]vlan batch 10 20 30 40 50
Info: This operation may take a few seconds. Please wait for a moment...done.
[s1]int vlanif 50
[s1-Vlanif50]ip ad    
[s1-Vlanif50]ip address 192.168.12.6 30
[s1-Vlanif50]int vlanif 30
[s1-Vlanif30]ip add    
[s1-Vlanif30]ip address 192.168.3.1 24
[s1-Vlanif30]int vlanif 40
[s1-Vlanif40]ip address 192.168.4.1 24
[s1-Vlanif40]q
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]port link-type access 
[s1-GigabitEthernet0/0/1]port default vlan 50
[s1-GigabitEthernet0/0/1]int g0/0/2  
[s1-GigabitEthernet0/0/2]port link-type trunk 
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 
[s1-GigabitEthernet0/0/2]q
[s1]rip
[s1-rip-1]version 2
[s1-rip-1]undo summary
[s1-rip-1]network 192.168.3.0
[s1-rip-1]network 192.168.4.0
[s1-rip-1]network 192.168.12.0
[s1-rip-1]q
[s1]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[s1]int vlanif 30
[s1-Vlanif30]dhcp select relay  
[s1-Vlanif30]dhcp relay server-ip 192.168.12.5
[s1-Vlanif30]int vlanif 40

[s1-Vlanif40]dhcp select relay 
[s1-Vlanif40]dhcp relay server-ip 192.168.12.5

交换机2(我命名错了,应该是s2):

 [r2]vlan batch 10 20 30 40 50 
Info: This operation may take a few seconds. Please wait for a moment...done.
[r2]int e0/0/1
[r2-Ethernet0/0/1]port link-type trunk    
[r2-Ethernet0/0/1]port trunk allow-pass vlan  10 20 30 40 50
[r2-Ethernet0/0/1]int e0/0/2
[r2-Ethernet0/0/2]port link-type access  
[r2-Ethernet0/0/2]port default vlan 10
[r2-Ethernet0/0/2]int e0/0/3 
[r2-Ethernet0/0/3]port link-type access 
[r2-Ethernet0/0/3]port default vlan 20
[r2-Ethernet0/0/3]

 交换机3(我命名错了,应该是s3):

[r3]vlan batch 10 20 30 40 50 
Info: This operation may take a few seconds. Please wait for a moment...done.

[r3]int e0/0/1 
[r3-Ethernet0/0/1]port link-type trunk 
[r3-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50
[r3-Ethernet0/0/1]int e0/0/2 
[r3-Ethernet0/0/2]port link-type access 
[r3-Ethernet0/0/2]port default vlan 30
[r3-Ethernet0/0/2]int e0/0/3
[r3-Ethernet0/0/3]port link-type access   
[r3-Ethernet0/0/3]port default vlan 40
[r3-Ethernet0/0/3]
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值