This article describes a scenario in which DHCP subscribers must be terminated in specific retailer routing-instances, but default RI (routing-instances) and retailer RI should NOT authenticate these DHCP subscribers. In order to terminate a DHCP subscriber in retailer routing-instances, the routing-instance name and IP pool name should be returned through radius attributes. The other way to do this is by using domain map feature. This article provides an example.
Goal: Terminate DHCP subscriber into retailer routing-instances, routing-instance name and ip pool name using domain map feature.
dynamic-profiles {
ip-demux-profile {
routing-instances {
"$junos-routing-instance" {
interface "$junos-interface-name" {
any;
}
} interfaces {
demux0 {
unit "$junos-interface-unit" {
demux-options {
underlying-interface "$junos-underlying-interface";
} family inet {
demux-source {
$junos-subscriber-ip-address;
} unnumbered-address "$junos-loopback-interface";
} single-auto-vlan-subinterface-profile {
interfaces {
"$junos-interface-ifd-name" {
demux-source inet;
vlan-id "$junos-vlan-id"; family inet;
family pppoe {
dynamic-profile pppoe-profile;
ge-1/1/7 {
flexible-vlan-tagging;
auto-configure {
vlan-ranges {
dynamic-profile single-auto-vlan-subinterface-profile {
accept any;
ranges {
} lo0 {
unit 10 {
family inet {
address 10.0.0.1/32;
system {
services {
dhcp-local-server {
authentication {
password test;
username-include {
domain-name isp1.com;
user-prefix test1;
} group dhcp-subscriber-guangzhou {
dynamic-profile ip-demux-profile; interface ge-1/1/7.0;
} access {
profile no-radius-auth {
authentication-order none;
} address-assignment {
#MUST define a pool which has same name as the one in the routing-instances RI-1. In fact , the ip address in this pool will never be used. pool pool1 { family inet {
network 192.168.0.0/24;
domain {
map isp1.com {
#assign a pool name. In fact, It is the pool1 in routing-instances RI-1 used to assign ip address address-pool pool1; target-routing-instance RI-1;
} routing-instances {
RI-1 {
instance-type virtual-router;
domain-name isp1.com; user-prefix test1;
group dhcp-subscriber-guangzhou {
dynamic-profile ip-demux-profile;
interface ge-1/1/7.0;
address-assignment {
pool pool1 {
network 10.0.0.0/24;
range r1 {
low 10.0.0.2;
high 10.0.0.100;
access-profile no-radius-auth; interface lo0.10;
lab@MX240-re1> show subscribers
Interface IP Address/VLAN ID User Name LS:RI ge-1/1/7.1073742167 100 default:default
demux0.1073742168 10.0.0.23 [email protected] default:RI-1 lab@MX240-re1> show route table summer.inet.0 RI-1.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.1/32 *[Direct/0] 1d 23:52:52 > via lo0.10 10.0.0.23/32 *[Access-internal/12] 00:00:45
> to #0 1c.af.f7.6a.52.45 via demux0.1073742168
lab@MX240-re1> ping 133.0.0.23 routing-instance RI-1 PING 133.0.0.23 (133.0.0.23): 56 data bytes 64 bytes from 133.0.0.23: icmp_seq=0 ttl=128 time=0.779 ms 64 bytes from 133.0.0.23: icmp_seq=1 ttl=128 time=0.384 ms ^C --- 133.0.0.23 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.384/0.582/0.779/0.198 ms lab@MX24-re1> show subscribers detail Type: VLAN Logical System: default Routing Instance: default Interface: ge-1/1/7.1073742167 Interface type: Dynamic Dynamic Profile Name: single-auto-vlan-subinterface-profile State: Active Session ID: 53967 VLAN Id: 100 Login Time: 2013-07-10 18:51:02 GMT+8 Type: DHCP User Name: [email protected] IP Address: 10.0.0.23 IP Netmask: 255.255.255.0 Logical System: default Routing Instance: RI-1 Interface: demux0.1073742168 Interface type: Dynamic Dynamic Profile Name: ip-demux-profile MAC Address: 1c:af:f7:6a:52:45 State: Active Radius Accounting ID: 53968 Session ID: 53968 VLAN Id: 100 Login Time: 2013-07-10 18:51:14 GMT+8 DHCP Options: len 59 35 01 01 74 01 01 3d 07 01 1c af f7 6a 52 45 0c 0f 63 68 69 6e 61 2d 33 34 32 37 37 38 30 35 35 3c 08 4d 53 46 54 20 35 2e 30 37 0b 01 0f 03 06 2c 2e 2f 1f 21 f9 2b 2b 02 dc 00