[ipxe-devel] DHCP option 121 (249) for ipxe

Atai Kadyrkulov atai.kadyrkulov at gmail.com
Thu Nov 16 13:28:19 UTC 2017


Hi,

I'm trying to add support for dhcp option 121 (
https://tools.ietf.org/rfc/rfc3442.txt).  So that when ipxe receives option
121 (or option 249 - microsoft dhcp server), it can add received routes to
it's routing table. Dhcp client must ignore option 3 Router, when it uses
routes from option 121.

I wrote functions that extract routes from a dhcp packet and add them to
the routing table. I am adding routes to the routing table in function
'ipv4_create_routes' (
https://github.com/ipxe/ipxe/blob/master/src/net/ipv4.c#L906) using
function 'add_ipv4_miniroute' (
https://github.com/ipxe/ipxe/blob/master/src/net/ipv4.c#L84).

Now I can see the routes with the 'route' command, but the problem is that
it's not working properly - I can't ping my gateway. For example:

   - dhcp sends network configuration: ip 172.31.1.100, netmask
   255.255.255.0, gateway 172.31.1.1 and normally ipxe adds route '
   172.31.1.100/255.255.255.0 gw 172.31.1.1' to its routing table (gateway
   is ping-able). But I'm ignoring this route, because
   - ipxe receives option 121 with the following routes: '
   172.31.1.1/255.255.255.255 gw 0.0.0.0' and '0.0.0.0/0 gw 172.31.1.1'.
   And with this routing table I can't ping 172.31.1.1

Could you, please, give me hints and tips to correctly implement this
feature? It seems that it's not so easy to do and I am missing a lot due to
my lack of experience.

Kind regards
Atai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20171116/91f4e42a/attachment.htm>


More information about the ipxe-devel mailing list