I'm trying to set up my Ubuntu server 16.04 LTS Xenial to run a DHCP Server that provides the required information to a very specific device.
That device is a TV Decoder by Orange ISP (French vendor is Sagem), and it only works if the IP address is assigned by the Livebox 3 by Orange (TM) (same vendor). This restriction avoids having a different DHCP server than the one provided by Orange.
If I want to use my own DHCP server running in Ubuntu 16.04 to avoid the one running at the Livebox (it's crappy) I need to adapt my configuration.
Bootstrap Protocol (ACK) using TV Decoder and DHCP, both from Sagem
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x35139a37
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.1.153
Next server IP address: 192.168.1.1
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_37:a1:9a (f0:82:61:37:a1:9a)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (ACK)
Length: 1
DHCP: ACK (5)
Option: (54) DHCP Server Identifier
Length: 4
DHCP Server Identifier: 192.168.1.1
Option: (51) IP Address Lease Time
Length: 4
IP Address Lease Time: (843s) 14 minutes, 3 seconds
Option: (58) Renewal Time Value
Length: 4
Renewal Time Value: (421s) 7 minutes, 1 second
Option: (59) Rebinding Time Value
Length: 4
Rebinding Time Value: (737s) 12 minutes, 17 seconds
Option: (1) Subnet Mask
Length: 4
Subnet Mask: 255.255.255.0
Option: (6) Domain Name Server
Length: 4
Domain Name Server: 192.168.1.1
Option: (15) Domain Name
Length: 4
Domain Name: home
Option: (28) Broadcast Address
Length: 4
Broadcast Address: 192.168.1.255
Option: (3) Router
Length: 4
Router: 192.168.1.1
Option: (125) V-I Vendor-specific Information
Length: 41
Enterprise: The Broadband Forum (formerly 'ADSL Forum') (3561)
Length: 36
Option 125 Suboption: (4) GatewayManufacturerOUI
Length: 6
GatewayManufacturerOUI: 307CB2
Option 125 Suboption: (5) GatewaySerialNumber
Length: 15
GatewaySerialNumber: AN16XXXXXXXXXX
Option 125 Suboption: (6) GatewayProductClass
Length: 9
GatewayProductClass: Livebox 3
Option: (255) End
Option End: 255
To emulate the same behavior from my own ISC DHCP Server in Ubuntu I had customized it, based on the found documentation and options.
Basically, the point is to send only to the TV decoder the following additional codes:
- Code 15: Domain name
- Code 72: Default World Wide Web Server.
- Code 125: V-I Vendor Specific Information
Based on the ISC DHCP server documentation, the three codes exist and they could be easily sent by adding the convinient options:
- domain-name text
- www-server ip-address
- vendor-encapsulated-options string
Firstly, I tried that way:
/etc/dhcp/dhcpd.conf
# Create an option namespace called orangetv
option space orangetv code width 1 length width 1;
option orangetv.GatewayManufacturerOUI code 4 = text;
option orangetv.GatewaySerialNumber code 5 = text;
option orangetv.GatewayProductclass code 6 = text;
# Linux Router
subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.1.1;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option routers 192.168.1.5;
range 192.168.1.100 192.168.1.199;
class "sagem-vendor-classes" {
match if substring(option vendor-class-identifier, 0, 5) = "sagem";
option domain-name "home";
option www-server 193.253.67.89;
vendor-options-space orangetv;
option orangetv.GatewayManufacturerOUI "307CB2";
option orangetv.GatewaySerialNumber "AN16XXXXXXXXXXX";
option orangetv.GatewayProductclass "Livebox 3";
}
}
Once the new config was saved, I checked the configuration syntax by running: sudo dhcpd -t -cf /etc/dhcp/dhcpd.conf
Then, I restarted the DHCP server to reload the new config (ISC DHCP 4.3 fails sometimes to restart and reload the new config. This is somehow related to the Apache2 server. Therefore I suggest forcing it):
sudo -i
service dhcp restart
service isc-dhcp-server restart
service isc-dhcp-server6 restart
service apache2 restart
Now, I rebooted the TV Decoded, and traced the network with Wireshark again. The result of the Bootstrap ACK was
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x70907f18
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.1.153
Next server IP address: 192.168.1.5
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_37:a1:9a (f0:82:61:37:a1:9a)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (ACK)
Length: 1
DHCP: ACK (5)
Option: (54) DHCP Server Identifier
Length: 4
DHCP Server Identifier: 192.168.1.5
Option: (51) IP Address Lease Time
Length: 4
IP Address Lease Time: (843s) 14 minutes, 3 seconds
Option: (1) Subnet Mask
Length: 4
Subnet Mask: 255.255.255.0
Option: (3) Router
Length: 4
Router: 192.168.1.5
Option: (6) Domain Name Server
Length: 4
Domain Name Server: 192.168.1.1
Option: (15) Domain Name
Length: 4
Domain Name: home
Option: (28) Broadcast Address
Length: 4
Broadcast Address: 192.168.1.255
Option: (72) Default WWW Server
Length: 4
Default WWW Server: 193.253.67.89
Option: (255) End
Option End: 255
Padding: 0000000000000000
As you notice, options 15 and 72 were correctly parsed by option 125 is missing. So, I tried to use the encapsulated vendor options as recommended in the manual. I Used
option vendor-encapsulated-options 7d:29:00:00:0d:XXXXXXXX:20:33
instead of the vendor-options-space method, but it failed again.
I used another workaround to send the code 125 as explained in [https://lists.isc.org/pipermail/dhcp-users/2012-July/015793.html][1]
/etc/dhcp/dhcpd.conf
# Create an option namespace called orangetv
option space orangetv code width 1 length width 1;
option orangetv.GatewayManufacturerOUI code 4 = text;
option orangetv.GatewaySerialNumber code 5 = text;
option orangetv.GatewayProductclass code 6 = text;
# Package the orangetv namespace into option 125
option space vivso code width 4 length width 1;
option vivso.orangetv code 3561 = encapsulate orangetv;
option vivso.iana code 0 = string;
option op125 code 125 = encapsulate vivso;
# Linux Router
subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.1.1;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option routers 192.168.1.5;
range 192.168.1.100 192.168.1.199;
class "sagem-vendor-classes" {
match if substring(option vendor-class-identifier, 0, 5) = "sagem";
option domain-name "home";
option www-server 193.253.67.89;
option vivso.iana 01:01:01;
option orangetv.GatewayManufacturerOUI "307CB2";
option orangetv.GatewaySerialNumber "AN16XXXXXXXXXXX";
option orangetv.GatewayProductclass "Livebox 3";
}
}
Despite these configurations, the DHCP server is not sending the code 125 win the vendor specifics.
Any other suggestions?