Hi, ipconfig is used in ltsp (thin clients) initramfs. Some of the users have to have 2 dhcp servers in ltsp environments, so they hit on this problem: The first dhcp request is from the pxe rom boot code. This code ignores any dhcp offers that don't have a filename field. So they always get the correct address, from the ltsp server. The second dhcp request (in initramfs) is done by ipconfig. And here is the problem, ipconfig accepts any offered addresses, even those that don't have the filename option. So the clients may get their ip from the wrong dhcp server (e.g. the adsl router) and fail to boot. What I'm asking for is a command line option, that forces ipconfig to ignore all DHCPOFFERs that do not have a filename option, so that it only accepts ip addresses from ltsp servers. Kind regards, Alkis Georgopoulos IP-Config: eth0 complete (from 128.131.48.127): address: 128.131.48.177 broadcast: 128.131.48.255 netmask: 255.255.255.0 gateway: 128.131.48.1 dns0 : 128.130.4.3 dns1 : 128.131.4.3 domain : itp.tuwien.ac.at rootserver: 128.131.48.127 rootpath: filename : /pxelinux.0 )
I tried "ipconfig -c bootp" and it did work, but some bootp servers log the offered ip and reserve it for the specific machine forever, so maybe emulating a pxe request would be better, something like ipconfig -c pxe eth0 (and just send the string PXEClient) Kind regards, Alkis 2008/5/24 ????? ???????????? <alkisg at gmail.com>:> Hi, > > ipconfig is used in ltsp (thin clients) initramfs. Some of the users > have to have 2 dhcp servers in ltsp environments, so they hit on this > problem: > The first dhcp request is from the pxe rom boot code. This code > ignores any dhcp offers that don't have a filename field. So they > always get the correct address, from the ltsp server. > > The second dhcp request (in initramfs) is done by ipconfig. And here > is the problem, ipconfig accepts any offered addresses, even those > that don't have the filename option. So the clients may get their ip > from the wrong dhcp server (e.g. the adsl router) and fail to boot. > > What I'm asking for is a command line option, > that forces ipconfig to ignore all DHCPOFFERs that do not have a > filename option, > so that it only accepts ip addresses from ltsp servers. > > Kind regards, > Alkis Georgopoulos > > IP-Config: eth0 complete (from 128.131.48.127): > address: 128.131.48.177 broadcast: 128.131.48.255 netmask: 255.255.255.0 > gateway: 128.131.48.1 dns0 : 128.130.4.3 dns1 : 128.131.4.3 > domain : itp.tuwien.ac.at > rootserver: 128.131.48.127 rootpath: > filename : /pxelinux.0 > ) >
????? ???????????? wrote:> Hi, > > ipconfig is used in ltsp (thin clients) initramfs. Some of the users > have to have 2 dhcp servers in ltsp environments, so they hit on this > problem: > The first dhcp request is from the pxe rom boot code. This code > ignores any dhcp offers that don't have a filename field. So they > always get the correct address, from the ltsp server. > > The second dhcp request (in initramfs) is done by ipconfig. And here > is the problem, ipconfig accepts any offered addresses, even those > that don't have the filename option. So the clients may get their ip > from the wrong dhcp server (e.g. the adsl router) and fail to boot. > > What I'm asking for is a command line option, > that forces ipconfig to ignore all DHCPOFFERs that do not have a > filename option, > so that it only accepts ip addresses from ltsp servers. >I think that would be a very bad idea. A much better idea would be to use the "ipappend 2" option to pxelinux, which passes the hardware address of the booting interface to the kernel. Then just bring *that* interface up. -hpa
> ipconfig is used in ltsp (thin clients) initramfs. Some of the users > have to have 2 dhcp servers in ltsp environments, so they hit on this > problem: > The first dhcp request is from the pxe rom boot code. This code > ignores any dhcp offers that don't have a filename field. So they > always get the correct address, from the ltsp server. > > The second dhcp request (in initramfs) is done by ipconfig. And here > is the problem, ipconfig accepts any offered addresses, even those > that don't have the filename option. So the clients may get their ip > from the wrong dhcp server (e.g. the adsl router) and fail to boot.Just to make whole thing on selecting offeres clear: http://www.tcpipguide.com/free/t_DHCPGeneralOperationandClientFiniteStateMachine.htm == SELECTING = Client Receives Offers, Selects Preferred Offer, Sends DHCPREQUEST: The client chooses one of the offers it has been sent, and broadcasts a DHCPREQUEST message to tell DHCP servers what its choice was. It transitions to the REQUESTING state == * => What I'm asking for is a command line option, > that forces ipconfig to ignore all DHCPOFFERs that do not have a > filename option, > so that it only accepts ip addresses from ltsp servers.'-s' (*s*kip: yes/no if bootpath proposed RFC patch) or '-s bootpath_condition' (*s*elect: todo). --- usr/kinit/ipconfig/main.c~ 2008-03-28 21:37:36.000000000 +0100 +++ usr/kinit/ipconfig/main.c 2008-05-27 00:58:07.222534500 +0200 @@ -23,8 +23,8 @@ #include "packet.h" +char do_not_config = 0; static const char sysfs_class_net[] = "/sys/class/net"; static const char *progname; static jmp_buf abort_buf; -static char do_not_config; static unsigned int default_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP; static int loop_timeout = -1; @@ -193,4 +193,6 @@ s->state = DEVST_ERROR; break; + case 0: /* Offer with no needed payload (see '-s') */ + return 0; case 1: /* Offer received */ s->state = DEVST_DHCPREQ; @@ -721,5 +723,5 @@ do { - c = getopt(argc, argv, "c:d:i:onp:t:"); + c = getopt(argc, argv, "c:d:i:onsp:t:"); if (c == EOF) break; @@ -758,4 +760,7 @@ do_not_config = 1; break; + case 's': + do_not_config = 2; + break; case 'd': dev = add_device(optarg); --- usr/kinit/ipconfig/dhcp_proto.c~ 2008-03-28 21:37:36.000000000 +0100 +++ usr/kinit/ipconfig/dhcp_proto.c 2008-05-27 00:57:46.285226000 +0200 @@ -16,4 +16,6 @@ #include "packet.h" +extern char do_not_config; + static uint8_t dhcp_params[] = { 1, /* subnet mask */ @@ -105,4 +107,6 @@ if (ret == 1 && serverid != INADDR_NONE) dev->serverid = serverid; + if (do_not_config == 2 && dev->bootpath[0] != '\0') + ret = 0; DEBUG(("\n dhcp offer\n")); break;