This article includes a configuration example of DHCP relay between different routing-instances. It also shows a typical configuration mistake and how to troubleshoot it.
DHCP-client sends DHCP DISCOVER message to routing-instance VR5 interface ge-0/0/0.313, where dhcp-relay is configured and relays the packet to DHCP-server with IP address 10.3.7.39 in routing-instance VR1:
Topology: DHCP-client---- <VR5> SRX <VR1> ----DHCP-server
DHCP-client---- <VR5> SRX <VR1> ----DHCP-server
user@srx> show configuration routing-instances VR5 instance-type virtual-router; interface ge-0/0/0.313; forwarding-options { dhcp-relay { forward-only; server-group { dhcp-gr2 { 10.3.7.39; } } group dhcp-gr2 { active-server-group dhcp-gr2; interface ge-0/0/0.313; } } }
Using these traceoptions, the following results are reported:
set system process dhcp-service traceoptions file <file> size <size> set system process dhcp-service traceoptions flag all Jun 20 11:28:54.397641 [MSTR][INFO] jdhcpd_io_recv_pkt: recvmsg() l3_ifindex: 104 Jun 20 11:28:54.397750 [MSTR][NOTE] jdhcpd_io_reader: Recv DHCP packet on logical-system default, routing-instance VR5, if ge-0/0/0.313 size 300 Jun 20 11:28:54.397821 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP from == 0.0.0.0, port == 68 ]-- Jun 20 11:28:54.397886 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP size == 300, op == 1 ]-- Jun 20 11:28:54.397927 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP flags == 8000 ]-- Jun 20 11:28:54.397965 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP htype == 1, hlen == 6 ]-- Jun 20 11:28:54.398004 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP hops == 0, xid == 1277256c ]-- Jun 20 11:28:54.398043 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP secs == 0, flags == 8000 ]-- Jun 20 11:28:54.398084 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP ciaddr == 0.0.0.0 ]-- Jun 20 11:28:54.398124 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP yiaddr == 0.0.0.0 ]-- Jun 20 11:28:54.398163 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP siaddr == 0.0.0.0 ]-- Jun 20 11:28:54.398203 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP giaddr == 0.0.0.0 ]-- Jun 20 11:28:54.398262 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP chaddr == 00 db 30 f1 d2 b1 00 00 00 00 00 00 00 00 00 00 ]-- Jun 20 11:28:54.398301 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP sname == ]-- Jun 20 11:28:54.398339 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ DHCP/BOOTP file == ]-- Jun 20 11:28:54.398387 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ OPTION code 53, len 1, data DHCP-DISCOVER ]-- Jun 20 11:28:54.398675 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] --[ OPTION code 255, len 0 ]-- Jun 20 11:28:54.398732 [MSTR][NOTE] jdhcpd_packet_handle: RECEIVE DISCOVER: stats_safd 0x0 , safd 0x9fa6c00 ge-0/0/0.313 Jun 20 11:28:54.398781 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_process_forward_only_or_drop: Safd ge-0/0/0.313 in routing context default:VR5 - forward only or drop processing Jun 20 11:28:54.398833 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_process_forward_only_or_drop: Forward-only-to-rc locally (no jump) Jun 20 11:28:54.398963 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_relay_forward_only_packet: Using server group dhcp-gr2, with 1 DHCP server(s) on interface ge-0/0/0.313 Jun 20 11:28:54.399015 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_forward_only_is_flow_based: enhanced broadband edge enabled: FALSE Jun 20 11:28:54.399059 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_forward_only_is_flow_based: ifs = 0x9fa6000 , ifs->flags = 0x3, SUS_FLAGS_FLOW_BASED = 0x1000 Jun 20 11:28:54.399100 [MSTR][INFO] jdhcpd_io_send_packet_legacy: Packet will be sent from routing context b Jun 20 11:28:54.399141 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_io_send_packet_legacy: Set the outgoing if to 104 Jun 20 11:28:54.399285 [MSTR][INFO] [default:VR5][RLY][INET][ge-0/0/0.313] jdhcpd_io_send_packet_legacy: DHCP PDU from 10.55.12.1 to 10.3.7.39 port 67 out interface 104 len 317
The DHCP-server responds with the DHCP OFFER, which is received at routing-instance VR1 but being dropped by SRX:
Jun 20 11:28:54.400604 [MSTR][INFO] jdhcpd_io_recv_pkt: recvmsg() l3_ifindex: 81 Jun 20 11:28:54.400700 [MSTR][NOTE] jdhcpd_io_reader: Recv DHCP packet on logical-system default, routing-instance VR1, if ge-0/0/0.163 size 307 Jun 20 11:28:54.400766 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP from == 10.3.7.39, port == 67 ]-- Jun 20 11:28:54.400813 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP size == 307, op == 2 ]-- Jun 20 11:28:54.400852 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP flags == 8000 ]-- Jun 20 11:28:54.400971 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP htype == 1, hlen == 6 ]-- Jun 20 11:28:54.401014 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP hops == 0, xid == 1277256c ]-- Jun 20 11:28:54.401053 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP secs == 0, flags == 8000 ]-- Jun 20 11:28:54.401094 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP ciaddr == 0.0.0.0 ]-- Jun 20 11:28:54.401135 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP yiaddr == 10.55.12.11 ]-- Jun 20 11:28:54.401175 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP siaddr == 10.3.7.39 ]-- Jun 20 11:28:54.401215 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP giaddr == 10.55.12.1 ]-- Jun 20 11:28:54.401273 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP chaddr == 00 db 30 f1 d2 b1 00 00 00 00 00 00 00 00 00 00 ]-- Jun 20 11:28:54.401312 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP sname == ]-- Jun 20 11:28:54.401997 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ DHCP/BOOTP file == ]-- Jun 20 11:28:54.402043 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ OPTION code 53, len 1, data DHCP-OFFER ]-- Jun 20 11:28:54.402466 [MSTR][INFO] [default:VR1][RLY][INET][ge-0/0/0.163] --[ OPTION code 255, len 0 ]-- Jun 20 11:28:54.402510 [MSTR][NOTE] [default:VR1][RLY][INET][ge-0/0/0.163] jdhcpd_packet_handle: dropping packet as routing context is not configured
Apart from the proper route sharing between the routing-instances, the routing-instances facing the DHCP-server must have " forward-only-replies " configured to support a client and a server to be in different logical systems/routing-instances. Also both routing-instances must have " instance-type virtual-router" configuration.
forward-only-replies
instance-type virtual-router" configuration.
To support DHCP relay between different routing-instances, both routing-instances must have the following configuration: routing-instances forwarding-options dhcp-relay forward-only routing-instance xxx-vr For example: set routing-instances VR1 instance-type virtual-router set routing-instances VR1 interface ge-0/0/0.163 set routing-instances VR1 routing-options instance-import routing-policy-VR1 set routing-instances VR1 forwarding-options dhcp-relay forward-only-replies set routing-instances VR5 instance-type virtual-router set routing-instances VR5 interface ge-0/0/0.313 set routing-instances VR5 forwarding-options dhcp-relay server-group dhcp-gr2 10.3.7.39 set routing-instances VR5 forwarding-options dhcp-relay group dhcp-gr2 active-server-group dhcp-gr2 set routing-instances VR5 forwarding-options dhcp-relay group dhcp-gr2 interface ge-0/0/0.313
routing-instances forwarding-options dhcp-relay forward-only routing-instance xxx-vr
set routing-instances VR1 instance-type virtual-router set routing-instances VR1 interface ge-0/0/0.163 set routing-instances VR1 routing-options instance-import routing-policy-VR1 set routing-instances VR1 forwarding-options dhcp-relay forward-only-replies set routing-instances VR5 instance-type virtual-router set routing-instances VR5 interface ge-0/0/0.313 set routing-instances VR5 forwarding-options dhcp-relay server-group dhcp-gr2 10.3.7.39 set routing-instances VR5 forwarding-options dhcp-relay group dhcp-gr2 active-server-group dhcp-gr2 set routing-instances VR5 forwarding-options dhcp-relay group dhcp-gr2 interface ge-0/0/0.313