[ipxe-devel] Problem with multiple interfaces and routing lookups

Jeffers, Steven steven.jeffers at emc.com
Tue Mar 15 19:10:33 UTC 2016


I am trying to load an iPXE from an untagged network and have it autoboot from a vlan tagged network.   I couldn't get this to work at first.   I ran into what could be a problem with the routing table lookup.   I was able to get it to work but the change might not be the best fix.

untagged network is
tagged network is

iPXE script:
vcreate --tag 4 --priority 2 net0
autoboot net0-4

In my testing, I saw iPXE was able to get a DHCP lease from the tagged network fine.  When it tried to TFTP to the DHCP server on the tagged network, it sent out packets using the untagged net0 interface and IP address as source address with a destination of the TFTP server on the tagged network.  I verified this by taking a network trace on the untagged network.

When I added the route command to the script, it showed net0 was listed before net0-4.   The route listed (DHCP server IP) as the gateway for net0.   I added some debug code to net/ipv4.c ipv4_route() function and found the first routing table entry was being returned because it matched the section of code below.   If every route has a gateway then I do not believe it will traverse the entire routing table.

                        /* If destination is an off-link global
                         * address, and we have a default gateway,
                         * then use this route.
                        if ( miniroute->gateway.s_addr ) {
                                *dest = miniroute->gateway;
                                return miniroute;


After commenting out this section, it used the net0-4 source IP address on the tagged network and was able to autoboot successfully.

Steven Jeffers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20160315/46e80c9a/attachment.htm>

More information about the ipxe-devel mailing list