EDIT : I was wrong in the following post. The real need is to be able to mark outgoing DHCP client packets with a DSCP value. The reason stays the same, the isp Orange need it to answer DHCP requests.
And then, since Orange use a VLAN, we need a DSCP=>CoS mapping which would work for dhcp packets going out a vlan interface.
Original post :
Hi,
In France, the number one ISP, Orange, need to receive DHCP Request with a COS of 6, otherwise, no answer is given.
This is a very big problem for the french users of RouterOS.Since DHCP use raw socket, you can't change the priority with a mangle queue. I've read some ideas about setting up a bridge, but using bridge firewall, bridge nat, etc, is not a real solution.
Before they put the CoS obligation, is was working just by creating a vlan832 and a dhcp client with some specific options like this :
/interface vlan
add interface=ether8 name=vlan832-orange vlan-id=832 mtu=1500 arp=enabled use-service-tag=no
/ip dhcp-client option
add code=77 name=userclass value=0x2b46535644534c5f6c697665626f782e496e7465726e65742e736f66746174686f6d652e4c697665626f7833
add code=90 name=authsend value=0x0000000000000000000000006674692fmylogininhexa
add code=60 name=vendor-class-identifier value=0x736167656d
Now, without CoS, no response.
Some wireshark captures (Livebox is the Orange router) :
DHCP Discover (Livebox -> Orange, vlan 832, CoS 6)
Frame 81: 380 bytes on wire (3040 bits), 380 bytes captured (3040 bits) on interface 0
Ethernet II, Src: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 6, CFI: 0, ID: 832
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68 (68), Dst Port: 67 (67)
Bootstrap Protocol (Discover)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x0cc032e9
Seconds elapsed: 1
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Discover)
Length: 1
DHCP: Discover (1)
Option: (55) Parameter Request List
Length: 11
Parameter Request List Item: (1) Subnet Mask
Parameter Request List Item: (3) Router
Parameter Request List Item: (6) Domain Name Server
Parameter Request List Item: (15) Domain Name
Parameter Request List Item: (28) Broadcast Address
Parameter Request List Item: (51) IP Address Lease Time
Parameter Request List Item: (58) Renewal Time Value
Parameter Request List Item: (59) Rebinding Time Value
Parameter Request List Item: (90) Authentication
Parameter Request List Item: (119) Domain Search
Parameter Request List Item: (120) SIP Servers
Option: (60) Vendor class identifier
Length: 5
Vendor class identifier: sagem
Option: (77) User Class Information
Length: 44
Instance of User Class: [0]
Option: (90) Authentication
Length: 22
Protocol: configuration token (0)
Algorithm: 0
Replay Detection Method: Monotonically-increasing counter (0)
RDM Replay Detection Value: 0x0000000000000000
Authentication Information: fti/xxxxxx
Option: (255) End
Option End: 255
DHCP Offer (Orange -> Livebox, vlan 832, CoS 7)
Frame 82: 426 bytes on wire (3408 bits), 426 bytes captured (3408 bits) on interface 0
Ethernet II, Src: Alcatel-_dc:fc:eb (84:26:2b:dc:fc:eb), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 7, CFI: 0, ID: 832
Internet Protocol Version 4, Src: 86.245.184.1, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 67 (67), Dst Port: 68 (68)
Bootstrap Protocol (Offer)
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x0cc032e9
Seconds elapsed: 1
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 86.245.xxx.xxx
Next server IP address: 80.10.247.176
Relay agent IP address: 80.10.237.69
Client MAC address: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Offer)
Length: 1
DHCP: Offer (2)
Option: (54) DHCP Server Identifier
Length: 4
DHCP Server Identifier: 80.10.247.176
Option: (51) IP Address Lease Time
Length: 4
IP Address Lease Time: (86400s) 1 day
Option: (1) Subnet Mask
Length: 4
Subnet Mask: 255.255.248.0
Option: (3) Router
Length: 4
Router: 86.245.184.1
Option: (6) Domain Name Server
Length: 8
Domain Name Server: 80.10.246.136
Domain Name Server: 81.253.149.6
Option: (59) Rebinding Time Value
Length: 4
Rebinding Time Value: (69200s) 19 hours, 13 minutes, 20 seconds
Option: (58) Renewal Time Value
Length: 4
Renewal Time Value: (43200s) 12 hours
Option: (28) Broadcast Address
Length: 4
Broadcast Address: 86.245.191.255
Option: (15) Domain Name
Length: 9
Domain Name: orange.fr
Option: (120) SIP Servers
Length: 42
SIP Server Encoding: Fully Qualified Domain Name (0)
SIP Server Name: sbct3g.PUT.access.orange-multimedia.net
Option: (90) Authentication
Length: 27
Protocol: configuration token (0)
Algorithm: 0
Replay Detection Method: Monotonically-increasing counter (0)
RDM Replay Detection Value: 0x0000000000000000
Authentication Information: dhcpliveboxfr250
Option: (255) End
Option End: 255
DHCP Request (Livebox -> Orange, vlan 832, CoS 6)
Frame 83: 392 bytes on wire (3136 bits), 392 bytes captured (3136 bits) on interface 0
Ethernet II, Src: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 6, CFI: 0, ID: 832
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68 (68), Dst Port: 67 (67)
Bootstrap Protocol (Request)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x0cc032e9
Seconds elapsed: 1
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Request)
Length: 1
DHCP: Request (3)
Option: (50) Requested IP Address
Length: 4
Requested IP Address: 86.245.xxx.xxxx
Option: (54) DHCP Server Identifier
Length: 4
DHCP Server Identifier: 80.10.247.176
Option: (55) Parameter Request List
Length: 11
Parameter Request List Item: (1) Subnet Mask
Parameter Request List Item: (3) Router
Parameter Request List Item: (6) Domain Name Server
Parameter Request List Item: (15) Domain Name
Parameter Request List Item: (28) Broadcast Address
Parameter Request List Item: (51) IP Address Lease Time
Parameter Request List Item: (58) Renewal Time Value
Parameter Request List Item: (59) Rebinding Time Value
Parameter Request List Item: (90) Authentication
Parameter Request List Item: (119) Domain Search
Parameter Request List Item: (120) SIP Servers
Option: (60) Vendor class identifier
Length: 5
Vendor class identifier: sagem
Option: (77) User Class Information
Length: 44
Instance of User Class: [0]
Option: (90) Authentication
Length: 22
Protocol: configuration token (0)
Algorithm: 0
Replay Detection Method: Monotonically-increasing counter (0)
RDM Replay Detection Value: 0x0000000000000000
Authentication Information: fti/xxxxxxx
Option: (255) End
Option End: 255
DHCP ACK (Orange -> Livebox, vlan 832, CoS 7)
Frame 84: 426 bytes on wire (3408 bits), 426 bytes captured (3408 bits) on interface 0
Ethernet II, Src: Alcatel-_dc:fc:eb (84:26:2b:dc:fc:eb), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 7, CFI: 0, ID: 832
Internet Protocol Version 4, Src: 86.245.184.1, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 67 (67), Dst Port: 68 (68)
Bootstrap Protocol (ACK)
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x0cc032e9
Seconds elapsed: 1
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 86.245.xxx.xxx
Next server IP address: 80.10.247.176
Relay agent IP address: 80.10.237.69
Client MAC address: Sagemcom_xx:xx:xx (00:37:b7:xx:xx:xx)
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: 80.10.247.176
Option: (51) IP Address Lease Time
Length: 4
IP Address Lease Time: (86400s) 1 day
Option: (1) Subnet Mask
Length: 4
Subnet Mask: 255.255.248.0
Option: (3) Router
Length: 4
Router: 86.245.184.1
Option: (6) Domain Name Server
Length: 8
Domain Name Server: 80.10.246.136
Domain Name Server: 81.253.149.6
Option: (59) Rebinding Time Value
Length: 4
Rebinding Time Value: (69200s) 19 hours, 13 minutes, 20 seconds
Option: (58) Renewal Time Value
Length: 4
Renewal Time Value: (43200s) 12 hours
Option: (28) Broadcast Address
Length: 4
Broadcast Address: 86.245.191.255
Option: (15) Domain Name
Length: 9
Domain Name: orange.fr
Option: (120) SIP Servers
Length: 42
SIP Server Encoding: Fully Qualified Domain Name (0)
SIP Server Name: sbct3g.PUT.access.orange-multimedia.net
Option: (90) Authentication
Length: 27
Protocol: configuration token (0)
Algorithm: 0
Replay Detection Method: Monotonically-increasing counter (0)
RDM Replay Detection Value: 0x0000000000000000
Authentication Information: dhcpliveboxfr250
Option: (255) End
Option End: 255
Thx a Lot