两个 L3 EX2200 Juniper 的 DHCP 中继(多少个中继?)

网络工程 路由 VLAN 杜松 杜松
2021-07-14 17:40:54

我遇到了这个教程:

Topology:

[Client PC] --- ge-0/0/0 [EX Switch] ge0/0/1 --- [DHCP Server]

Client PC is in VLAN 10.

The DHCP server is in VLAN 20 with the 20.20.20.2 IP address.

The EX switch is configured as DHCP relay and performs inter VLAN routing between VLANs 10 and 20.

Configuration:
set vlans vlan10 vlan-id 10
set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members vlan10
set vlans vlan10 l3-interface vlan.10
set interfaces vlan unit 10 family inet address 10.10.10.1/24

set vlans vlan20 vlan-id 20
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members vlan20
set interfaces vlan unit 20 family inet address 20.20.20.1/24
set vlans vlan20 l3-interface vlan.20
set forwarding-options helpers bootp server 20.20.20.2
set forwarding-options helpers bootp interface vlan.10

Note: VLAN.10 Routed VLAN Interface (RVI) is configured for bootp relay, so that bootp packets in VLAN 10 will be routed to the '20.20.20.2' server in VLAN 20. Configure the specific RVIs, to which the bootp packets should be forwarded. A separate server can be configured under the 'bootp interface vlan.X' stanza for only that specific VLAN. A global server IP can also be specified (as above), which is applicable for all RVI interfaces.

我有一个类似的设置,除了在同一台交换机上不是两个 vlan,我有两个交换机使用 OSPF 连接在一起。在我的代码中,我使用了相同的设置,但我想知道我需要多少个继电器。每个交换机上一个,还是没有 dhcp 服务器的交换机上只有一个?

1个回答

每个 VLAN 只需要一个。基本上,当您在 VLAN 接口上配置 dhcp 中继(IP 助手)时,交换机会将 DHCP 请求转发到您提供的 IP 助手。这将成为单播流量并路由到 DHCP 服务器,该服务器应该是您在set forwarding-options helpers bootp server 20.20.20.2设置的 IP 地址

如果 20.20.20.2 是可达的,它离开多少跳都无关紧要。只要确保你有一个返回的路线路径。如果 DHCP 服务器无法访问向 DHCP 服务器请求 IP 地址的客户端,并且有时人们会忘记您需要双向路由,则它将无法工作。

所以总结一下:

为与 DHCP 服务器不在同一子网(甚至跨 Internet)上的每个 vlan 设置 DHCP 中继配置。该配置只需要在用作网关的交换机/路由器上进行设置。您不需要在边缘交换机或网关之后的任何交换机上设置配置。

希望这对您的追求有所帮助。

困人