[syslinux] Checking if host is on the same subnet

Ferenc Wagner wferi at niif.hu
Wed Dec 10 07:14:19 PST 2014


Alexandre Blanchette <blanalex at gmail.com> writes:

> We are doing a deployment across many sites, we're doing one site at a time
> and we're bringing a "mobile server" (a laptop, really) to keep traffic
> local instead saturating the WAN link of each site.
>
> I'd like to make a script so each client can determine if the mobile server
> is on the same subnet either with a ping with a zero TTL value, with the
> ip/netmask and a bit of binary logic, or any other mean.
>
> Currently, PXELINUX is calling an iPXE script, so the solution can be at
> either level.

You should be able to do this via Lua and its DHCP module.  You will
find partial documentation only, but for generic info see
https://github.com/wferi/syslinux/blob/pub/com32/lua/doc/syslinux.asc
(the loadfile and initramfs parts document a future plan) and
https://github.com/wferi/syslinux/blob/pub/com32/lua/src/dhcp.c
(but don't forget the dhcp = require "dhcp").
-- 
Regards,
Feri.


More information about the Syslinux mailing list