首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关于子接口DHCP中继思科的问题

关于子接口DHCP中继思科的问题
EN

Network Engineering用户
提问于 2022-03-13 01:44:28
回答 2查看 323关注 0票数 0

我想让4 PC得到DHCP IP地址没有问题与左侧,但右侧2 PC不能获得IP自动化。我想问题是DHCP继电器。如何使用ip助手地址作为R2的子接口?

s1

代码语言:javascript
复制
 interface FastEthernet0/1
   switchport mode trunk
 interface FastEthernet0/2
   switchport access vlan 11
   switchport mode access
 interface FastEthernet0/3
   switchport access vlan 10
   switchport mode access

s2

代码语言:javascript
复制
 interface FastEthernet0/1
   switchport mode trunk
 interface FastEthernet0/2
   switchport access vlan 20
   switchport mode access
 interface FastEthernet0/3
   switchport access vlan 30
   switchport mode access

R1-DHCP

1.建筑物配置..。

代码语言:javascript
复制
Current configuration : 1593 bytes
!
version 15.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
ip dhcp pool Area-1
 network 192.168.11.0 255.255.255.0
 default-router 192.168.11.1
ip dhcp pool Area-2
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
ip dhcp pool Area-3
 network 192.168.20.0 255.255.255.0
 default-router 192.168.20.1
ip dhcp pool Area-4
 network 192.168.30.0 255.255.255.0
 default-router 192.168.30.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0/0
 ip address 190.168.50.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
!
interface GigabitEthernet0/0/0.30
 encapsulation dot1Q 30
 ip address 192.168.30.1 255.255.255.0
!
interface GigabitEthernet0/0/1
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1.10
 encapsulation dot1Q 10
 ip address 192.168.10.1 255.255.255.0
!
interface GigabitEthernet0/0/1.11
 encapsulation dot1Q 11
 ip address 192.168.11.1 255.255.255.0
!
interface GigabitEthernet0/0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 version 2
 network 192.168.20.0
 network 192.168.30.0
 network 192.168.50.0
 no auto-summary
!
ip classless
ip route 192.168.20.0 255.255.255.0 192.168.50.2 
ip route 192.168.30.0 255.255.255.0 192.168.50.2 
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

R2

代码语言:javascript
复制
Building configuration...

Current configuration : 1151 bytes
!
version 15.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0/0
 ip address 192.168.50.2 255.255.255.0
 ip helper-address 192.168.50.1
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0/1.20
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
 ip helper-address 192.168.50.1
!
interface GigabitEthernet0/0/1.30
 encapsulation dot1Q 30
 ip address 192.168.30.1 255.255.255.0
 ip helper-address 192.168.50.1
!
interface GigabitEthernet0/0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 version 2
 network 192.168.10.0
 network 192.168.11.0
 network 192.168.50.0
 no auto-summary
!
ip classless
ip route 192.168.10.0 255.255.255.0 192.168.50.1 
ip route 192.168.11.0 255.255.255.0 192.168.50.1 
!
ip flow-export version 9
EN

回答 2

Network Engineering用户

发布于 2022-03-13 15:21:16

一些问题:

  • ip helper-address 192.168.50.2 --您已经将路由器本身添加为DHCP服务器。那条线得走了。
  • 没有为VLAN 30设置DHCP中继。
  • 为每个路由器上的远程网络添加静态路由。实际上,每个路由器只看到立即连接的网络。由于缺乏路由,其他网络的数据包被丢弃。
  • 目前,您已经在R1/Gig0.0.0 (面向R2)上为VLAN 20和30提供了子接口。这是无法工作的,因为在整个L2中没有R2连接。同时,DHCP中继不能工作(表面上)直接连接的IP子网;路由也不能正常工作。您需要删除这些子接口。
票数 0
EN

Network Engineering用户

发布于 2022-03-14 11:33:38

这应该通过R2进行配置。

代码语言:javascript
复制
ip dhcp pool Area-3
 network 192.168.20.0 255.255.255.0
 default-router 192.168.20.1
ip dhcp pool Area-4
 network 192.168.30.0 255.255.255.0
 default-router 192.168.30.1
票数 0
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/78212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档