Hello
I have a need to use an XO with a USB-Ethernet adapter and an Internet
connection with no DHCP that requires me to set the network up on the XO.
I can easily do the IP and netmask with
/sbin/ifconfig eth0 [IP] netwmask [mask]
and the gateway with
/sbin/route add default gw [GW-IP]
Can anyone tell me the best way to set up the DNS? I tried the following in
rc.local which results in me being able to ping hosts on the Internet but
DNS is not working, have I made a mistake?:
addNameServer ()
{
ip="$1"
file="/etc/resolv.conf"
result=`cat "${file}" | grep -c "${ip}"`
if [ ${result} -eq 0 ]
then
echo "nameserver ${ip}" >> "${file}"
fi
}
/etc/init.d/NetworkManager stop
/sbin/ifconfig eth0 [Static IP] netmask [mask] up
/sbin/route add default gw [Gateway IP]
addNameServer "[DNS IP 1]"
addNameServer "[DNS IP 2]"
David
_______________________________________________
Devel mailing list
[email protected]
http://lists.laptop.org/listinfo/devel