Posts

Showing posts with the label DHCP

[ Level 3 ] The script for creating virtualbox envrionment (Ubuntu 12.04) with lauch new OS image.

In my company, I need to test it when I build a new image. Therefore I have to setup my testing environment for integration test. I wrote a script to automatically setup the environment from new install Ubuntu. The steps are: 1. Download and setup tftp server. 2. Download and setup dhcp server with netboot option. 3. Install virtualbox. After that you could create a VM then choose netboot. (the first interface must connect to tap0 to get boot server information) #!/bin/bash ######## utilities ######## _getTasks() { indent="$1" cat $0 | grep '()' | grep -v "^_" | grep "^[^ ]" | cut -d'(' -f1 | sed -e "s/^/$indent/" } _showUsage() { indent=" " cat <<EOF Usage: $0 task Ex. $0 `_getTasks | head -1` tasks: ${indent}[ all ] `_getTasks "$indent"` EOF } _die() { echo "$1" exit ${2:-1} } _checkID() { uid=`id | cut -d'(' -f1 | cut -d'=' -f2` [ $uid -ne ...

[Level 2] How to reserve ip (query only) from dchp server by dhclient in Ubuntu.

If you want to reserve ip (query only) from dhcp server by dhclient in Ubuntu, you can use the following command to do so. # dhclient -q -sf /dev/null -lf /tmp/dhclient.lease -pf /tmp/dhclient.pid Then you can see the lease file (/tmp/dhclient.lease) to get more information. PS. In my test, dhclient 3.1 ( in Ubuntu 10.04 ) will have an error with no permission. Therefore, I download the latest version of dhclient (4.1) from isc . you can get more information from here . Wish this helps. regards, Stanley Huang

How to setup your wireless interface to auto connect to ap in Ubuntu?

How to setup your wireless interface to auto connect to ap in Ubuntu? You can set the config in /etc/network/interface like below: wlan0 auto iface wlan0 inet dhcp wireless-essid your_essid wireless-key your_essid_passphrase wireless-channel your_essid_channel Wish this helps. regards, Stanley Huang

[Level 3] How to get option 43 from dchp server.

You can following the steps to implement get option 43 from dhcp server. [server side] 1. install dhcp  server: # apt-get install dhcp3-server 2. modify /etc/default/dhcp3-server: (modify) INTERFACES="eth0" 3. modify /etc/dhcp3/dhcpd.conf: (add) option space VendorInfo; option VendorInfo.text code 10 = { text }; subnet 192.168.2.0 netmask 255.255.255.0 {   range 192.168.2.2 192.168.2.9;   filename "pxelinux.0";   option subnet-mask 255.255.255.0;   option broadcast-address 192.168.2.255;   vendor-option-space VendorInfo;   option VendorInfo.text "option43 text"; } 4. restart server: # /etc/init.d/dhcp3-server restart [client side] 1. modify /etc/dhcp3/dhclient.conf: (add) option space VendorInfo; option VendorInfo.text code 10 = { text }; (modify) request subnet-mask, broadcast-address, time-offset, routers,         domain-name, domain-name-servers, domain-search, host-name,  ...