Technical Tip

Changing NIC Settings for ZENworks Imaging

Author Info

17 October 2006 - 11:00pm
Submitted by: descent

tip
Reads:

491

Score:
0
0
 
Comments:

0

When using ZENworks Imaging the imaging kernel comes up with the NIC configured for auto-negotiate. If your switch port is hard coded, this conflict causes imaging to take considerably longer. In order to resolve this you can use ethtool to change the settings on the interface. Of course this takes a few minutes to type and it would be way cooler to create a script to do this. So I did!

Solution

Part of this is excerpted from the ZENworks documentation. Start by getting the root image mounted so we can add to it.

  1. Using a Linux machine, create a working directory and change to that directory.
    I created /media/iso
  2. To copy root from the PXE server to the new working directory:
    copy \tftp\boot\root to a directory on the Linux machine
    I copied mine to /var/tmp/zen
  3. To rename root to root.gz, enter:
    mv root root.gz
  4. To unzip the root.gz file, enter:
    gunzip root.gz
  5. To mount the root file system to the directory from step one, enter:
    mount -o loop root /media/iso

Now we need to put our script into the kernel. I chose to create a /usr/local/bin directory for the script to live in (in case I want to add more personalized stuff later).

  1. cd /media/iso/usr
  2. mkdir local/bin
  3. cd local/bin
  4. vi <name you want to use>
    I chose to use "setfull" as my command.
  5. Paste the following script in to vi:
    #!/bin/bash
    #This script sets the NIC to 100/full
    #Author W.Schneider 10-10-2006
    #
    echo -e '\E[31;40m----------------------------------------------\E[37;40m'
    echo -e '\E[31;40mInitial Settings\E[37;40m'
    /usr/sbin/ethtool eth0 | egrep "Advertised auto-neg|Speed|Duplex|Auto-negotiation:"
    /usr/sbin/ethtool -s eth0 autoneg off
    /usr/sbin/ethtool -s eth0 duplex full
    /usr/sbin/ethtool -s eth0 speed 100
    echo -e '\E[31;40m----------------------------------------------\E[37;40m'
    echo -e '\E[32;40m----------------------------------------------\E[37;40m'
    echo -e '\E[32;40mChanged Settings\E[37;40m'
    /usr/sbin/ethtool eth0 | egrep "Advertised auto-neg|Speed|Duplex|Auto-negotiation:"
    echo -e '\E[32;40m----------------------------------------------\E[37;40m'
  6. Save the file (type ESC, hold shift and press ZZ)
  7. Now make the file executable using chmod
    chmod 755 setfull
  8. Now we need to edit the path variable so that our new directory is in the executable path.
    vi /media/iso/etc/bash.bashrc
    append the new directory to the export statement as follows:
    export PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin
  9. Save this file.
  10. To unmount the root file system first change to a different directory
    cd /var/tmp/zen
    umount /media/iso
  11. Now we need to zip the filesystem back up
    gzip –v9c root > root.gz
  12. Rename the file
    mv root.gz root

Now just copy the file back to your tftp directory and you are done!

To use this, after you get to the bash prompt simply type the name of your script. The output should look like this:



If you have any questions you may contact William. Click on his author name under the title of this article, and scroll to the bottom of his list of contributions where there is a "Contact this Author" box.


Author Info

17 October 2006 - 11:00pm
Submitted by: descent




User Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <p> <a> <em> <i> <strong> <cite> <code> <img><ul> <ol> <li> <div> <dl> <dt> <dd> <h1> <b> <strong> <h2> <h3> <pre> <table> <td> <tr> <th> <blockquote>
  • Lines and paragraphs break automatically.
  • Glossary terms will be automatically marked with links to their descriptions. If there are certain phrases or sections of text that should be excluded from glossary marking and linking, use the special markup, [no-glossary] ... [/no-glossary]. Additionally, these HTML elements will not be scanned: a, abbr, acronym, code, pre.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

© 2008 Novell, Inc. All Rights Reserved.