make it easier to specify alternate DHCP ports

Bug #198356 reported by laga
6
Affects Status Importance Assigned to Milestone
ltsp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

As discussed with Oliver Grawert. See patch:

laga@prometheus:~/dev/ltsp/ltsp-5.0.40~bzr20080212/client/initramfs$ bzr diff -r1
=== modified file 'conf.d/ltsp'
--- conf.d/ltsp 2008-03-04 12:35:43 +0000
+++ conf.d/ltsp 2008-03-04 12:48:53 +0000
@@ -1,2 +1,13 @@
 MODULES="netboot"
 BOOT="ltsp_nbd"
+
+# DHCPPORT: tell ipconfig from klibc-utils) to use an alternate DHCP port
+# Default: 68
+# example: if you want to use alternate DHCP ports, use something like
+# DHCPPORT="1068"
+# Your DHCP server will have to listen on $DHCPPORT - 1
+# Note: for alternate DHCP ports, see
+# http://<email address hidden>/msg31182.html
+# That mail might be a bit outdated but it still gives a nice overview
+# DHCPPORT=""
+

=== modified file 'scripts/ltsp_nbd'
--- scripts/ltsp_nbd 2008-03-04 12:35:43 +0000
+++ scripts/ltsp_nbd 2008-03-04 13:24:15 +0000
@@ -7,6 +7,14 @@
        run_scripts /scripts/nfs-top
        [ "$quiet" != "y" ] && log_end_msg

+ if [ -n "$dhcpport" ]; then
+ DHCPPORT="$dhcpport"
+ fi
+
+ if [ -n "$DHCPPORT" ]; then
+ IPCONFIGARGS="-p $DHCPPORT $IPCONFIGARGS"
+ fi
+
        # For DHCP
        modprobe -q af_packet

@@ -16,13 +24,13 @@
                        ;;
                ""|on|any)
                        # Bring up device
- ipconfig ${DEVICE}
+ ipconfig ${DEVICE} $IPCONFIGARGS
                        ;;
                dhcp|bootp|rarp|both)
- ipconfig -c ${IPOPTS} -d ${DEVICE}
+ ipconfig -c ${IPOPTS} -d ${DEVICE} $IPCONFIGARGS
                        ;;
                *)
- ipconfig -d $IPOPTS
+ ipconfig -d $IPOPTS $IPCONFIGARGS

                        # grab device entry from ip option
                        NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}

Related branches

Revision history for this message
laga (laga) wrote :

Update: also document the dhcpport= option in conf.d/ltsp

=== modified file 'conf.d/ltsp'
--- conf.d/ltsp 2008-03-04 12:35:43 +0000
+++ conf.d/ltsp 2008-03-04 13:38:08 +0000
@@ -1,2 +1,14 @@
 MODULES="netboot"
 BOOT="ltsp_nbd"
+
+# DHCPPORT: tell ipconfig from klibc-utils) to use an alternate DHCP port
+# Default: 68
+# example: if you want to use alternate DHCP ports, use something like
+# DHCPPORT="1068"
+# this variable can be overridden using the dhcpport= boot option
+# Your DHCP server will have to listen on $DHCPPORT - 1
+# Note: for alternate DHCP ports, see
+# http://<email address hidden>/msg31182.html
+# That mail might be a bit outdated but it still gives a nice overview
+# DHCPPORT=""
+

=== modified file 'scripts/ltsp_nbd'
--- scripts/ltsp_nbd 2008-03-04 12:35:43 +0000
+++ scripts/ltsp_nbd 2008-03-04 13:24:15 +0000
@@ -7,6 +7,14 @@
        run_scripts /scripts/nfs-top
        [ "$quiet" != "y" ] && log_end_msg

+ if [ -n "$dhcpport" ]; then
+ DHCPPORT="$dhcpport"
+ fi
+
+ if [ -n "$DHCPPORT" ]; then
+ IPCONFIGARGS="-p $DHCPPORT $IPCONFIGARGS"
+ fi
+
        # For DHCP
        modprobe -q af_packet

@@ -16,13 +24,13 @@
                        ;;
                ""|on|any)
                        # Bring up device
- ipconfig ${DEVICE}
+ ipconfig ${DEVICE} $IPCONFIGARGS
                        ;;
                dhcp|bootp|rarp|both)
- ipconfig -c ${IPOPTS} -d ${DEVICE}
+ ipconfig -c ${IPOPTS} -d ${DEVICE} $IPCONFIGARGS
                        ;;
                *)
- ipconfig -d $IPOPTS
+ ipconfig -d $IPOPTS $IPCONFIGARGS

                        # grab device entry from ip option
                        NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}

Revision history for this message
laga (laga) wrote :

Oliver Grawert knows how to make things simpler.
You probably want to make sure that the indentation is correct, I'm probably incapable of configuring my editor correctly.

=== modified file 'conf.d/ltsp'
--- conf.d/ltsp 2008-03-04 12:35:43 +0000
+++ conf.d/ltsp 2008-03-04 13:38:08 +0000
@@ -1,2 +1,14 @@
 MODULES="netboot"
 BOOT="ltsp_nbd"
+
+# DHCPPORT: tell ipconfig from klibc-utils) to use an alternate DHCP port
+# Default: 68
+# example: if you want to use alternate DHCP ports, use something like
+# DHCPPORT="1068"
+# this variable can be overridden using the dhcpport= boot option
+# Your DHCP server will have to listen on $DHCPPORT - 1
+# Note: for alternate DHCP ports, see
+# http://<email address hidden>/msg31182.html
+# That mail might be a bit outdated but it still gives a nice overview
+# DHCPPORT=""
+

=== modified file 'scripts/ltsp_nbd'
--- scripts/ltsp_nbd 2008-03-04 12:35:43 +0000
+++ scripts/ltsp_nbd 2008-03-04 14:16:02 +0000
@@ -7,6 +7,10 @@
        run_scripts /scripts/nfs-top
        [ "$quiet" != "y" ] && log_end_msg

+ if [ -n "$dhcpport" ]; then
+ DHCPPORT="$dhcpport"
+ fi
+
        # For DHCP
        modprobe -q af_packet

@@ -19,6 +23,9 @@
                        ipconfig ${DEVICE}
                        ;;
                dhcp|bootp|rarp|both)
+ if [ ${IPOPTS} == "dhcp"] && [ -n "$DHCPPORT" ]; then
+ IPOPTS="${IPOPTS} -p ${DHCPPORT}"
+ fi
                        ipconfig -c ${IPOPTS} -d ${DEVICE}
                        ;;
                *)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltsp - 5.0.40~bzr20080212-0ubuntu4

---------------
ltsp (5.0.40~bzr20080212-0ubuntu4) hardy; urgency=low

  * make sure the right proxy line is set in the chroot, thanks
    to stephane graber for that fix (LP: #213927)
  * make acpid [ i386 amd64 ] only dependency, since its not not available on ppc
    (LP: #213014, LP: #199747)
  * fix configure-x.sh interpreter line (LP: #196706)
  * make sure resolv.conf is available in the chroot (LP: #72482)
  * merge fix for dhcp port handling, thanks to Michael Haas, (LP: #198356)
  * we only tell users with nfs-kernel-server installed that they need to
    update /etc/exports (LP: #198915)
  * fix kiosk plugin to use the right package names (LP: #163278, LP: #212738)
  * fix hardcoded path in ltsp-update-image and quiten down noisy rm commands
    (LP: #198157)
  * make sure the ltsp-update-* scripts operate on symlinked dirs (LP: #151503)
  * add final updates for mythbuntu plugin and drop accidentially included
    patch file from debian/extra-plugins (LP: #212550)

 -- Oliver Grawert <email address hidden> Tue, 08 Apr 2008 15:03:51 +0200

Changed in ltsp:
status: New → Fix Released
Revision history for this message
Brendan Grieve (brendan-grieve) wrote :

This is NOT fixed yet (Hardy 8.04). Excuse my very rushed comment.

First, a typo

- if [ ${IPOPTS} == "dhcp"] && [ -n "$DHCPPORT" ]; then
+ if [ ${IPOPTS} == "dhcp" ] && [ -n "$DHCPPORT" ]; then

(Note the space)

Second. I'm still unsure if $IPOPTS should be in ipconfig long format as described here: -
  - http://codtech.com/wiki/index.php/Ipconfig#interface_spec_long_form

Or if it is something more simpler (ie kernel command line 'ip=dhcp'). Or is it both?
If I pass the following kernel command line:
  ip=172.16.200.100:172.16.200.1:::::none
the client gets assigned a static IP correctly.

If I pass: -
  ip=:172.16.200.1:::::dhcp

the script fails as its expecting 'dhcp' as its only parameter (${IPOPTS} == "dhcp").

Revision history for this message
Steve Cayford (cayfo001) wrote :

Has this bug been reintroduced to jaunty? Neither the "dhcpport" boot param nor the setting in /usr/share/initramfs-tools/conf.d/ltsp (in the chroot) seem to have any effect. I can get an alternate dhcp port by explicitly tacking "-p 1068" onto the ipconfig command in /usr/share/initramfs-tools/scripts/functions, but as far as I can tell there is no "cleaner" way to set this.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

gpxe (etherboot) also dropped support for alternate DHCP ports.
An alternative method: https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP
In my case this was even better than changing the DHCP ports, because the proxy dhcp method also works with standard PXE clients.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.