Comment 2 for bug 26949

Revision history for this message
nahs (nahs777) wrote : Re: DHCP requires manual configuration for KT (Korean ISP)

I made some script for automake dhclient.conf for KT.

it isn't good code.(I am poor at make script) But you will know how dhclient.conf make to work properly.

I heard that sending Mac Address for Identification is standard for DHCP.

Can't ubuntu installer make this configuration file during Installation Sessions?

here is my script:

#!/bin/bash
# wrtten by nahs (nahs.pe.kr) gpl v2

echo "AutoMake KT dhcp client setting Program"
echo "This program is for Ubuntu or Debian System with dhcpclient"
echo "Written by Nahs(http://nahs.pe.kr/) lisence GPL v2"
echo

if [ `whoami` != "root" ]
then
 echo "You must excute this file with root."
 echo "Do sudo ./$0 eth*"
 echo ""
 exit 1
fi
ethname=$1
if [ "$ethname" == "" ]
then
 echo "You Must Select which adapter is connected with Internet."
 echo "If you have just one ethernet adapter. do sudo ./$0 eth0"
 echo ""
 exit 1
fi

macadress="`/sbin/ifconfig eth0 | sed -n -e '/^.*HWaddr \([:[:xdigit:]]*\).*/{s//\1/;y/ABCDEF/abcdef/;p;q;}'`"
hname=`cat /etc/hosts | grep 127.0.1.1 | cut -b 11-`
mv -f /etc/dhcp3/dhclient.conf /etc/dhcp3/dhclient.conf.old
echo "interface \"$ethname\" {" >> /etc/dhcp3/dhclient.conf
echo "send host-name \"$hname\";" >> /etc/dhcp3/dhclient.conf
echo "send dhcp-client-identifier $macadress;" >> /etc/dhcp3/dhclient.conf
echo "}" >> /etc/dhcp3/dhclient.conf

cp -f /etc/network/interfaces /etc/network/interfaces.old
if [ "`cat /etc/network/interfaces | grep "iface $ethname inet"`" == "iface $ethname inet dhcp" ]
 then
 echo "finished"
elif [ "`cat /etc/network/interfaces | grep "iface $ethname inet"`" == "iface $ethname inet static" ]
 then
 sed -e "s/iface $ethname inet static/iface $ethname inet dhcp/" /etc/network/interfaces > interfaces.temp
 mv -f interfaces.temp /etc/network/interfaces
 rm interfaces.temp
 echo "finished"
else
  echo "auto $ethname" >> /etc/network/interfaces
  echo "iface $ethname inet dhcp" >> /etc/network/interfaces
  echo "finished" >> /etc/network/interfaces
fi

echo "Now restarting network"
/etc/init.d/networking restart

--

And Losing connection is a big Problem. I don't know why it happen. but it didn't occur in breezy or earlier version.

KT gives user ip for very short lease time..(maybe 1200 sec..) I think dapper has problem when regain ip from server.