longship
Group: Members
Posts: 9
Joined: Nov. 2004 |
|
Posted: Dec. 08 2004,20:46 |
|
If you don't run DHCP and you need a static network configuration the HD install can be frustrating. After every boot you have to reenable your network configuration. This article shows how to fix this problem so that you can configure your network the Un*x way and have the DSL scripts respect that configuration.
The general procedure is to first modify the DSL boot and shutdown scripts to respect the standard Linux network configuration files. Second, add the nodhcp parameter to Lilo boot parameters. Finally, configure your network interfaces and reboot.
Before doing these steps make sure that you are root. Bring up a terminal and enter the following:
Step 1 - Modify DSL scripts in /etc/init.d
1. Edit /etc/init.d/knoppix-autoconfig to bring up network interfaces.
Near line 800, find the code that looks like this: (Search for "nodhcp")
Code Sample | if checkbootparam "nodhcp"; then echo " ${BLUE}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}" ...blah, blah, blah... else
|
Delete the "...blah, blah, blah..." part and add the following code after the echo... line but before the else line:
Code Sample | echo " ${BLUE}Attempting configured network interfaces.${NORMAL}" NETDEVICES="$(awk '/auto/{for (i = 1; i <= NF; i++) if ($i ~ /eth[0-9]/) printf("%s ", $i)}' </etc/network/interfaces)" for n in $NETDEVICES; do echo " ${MAGENTA}Bringing up $n${NORMAL}" ifup $n done
|
This code parses the ethx interfaces out of the /etc/network/interfaces file and brings those interfaces up using ifup. N.B., Do not use ifconfig to bring up interfaces!
2. Edit /etc/init.d/knoppix-halt and /etc/init.d/knoppix-reboot to shut down the network properly.
In both files: Replace:
Code Sample | ifconfig $n down |
with:
Step 2 - Add nodhcp to lilo.conf.
Edit the file /etc/lilo.conf
Find the line that reads append="blah blah blah"
Add nodhcp to the statement within the quote marks. E.G., it should now read:
Code Sample | append="blah blah blah nodhcp" |
Save the file.
Run the lilo program. From the command line enter:
It you made the correct change, it should update the boot record and reinstall lilo.
Step 3 - Modify /etc/network/interfaces
The DSL script netcardconfig will add the necessary ethx interface to /etc/network/interfaces for you. Either run this script or modify the file manually. If you don't know how to do this Google is your friend. Note that my fix allows you to put in as many ethx interfaces as you need.
That's it! When you reboot your network cards should be brought up just like they're supposed to. Just as important, shutting down, or rebooting should shut them down.
|