On Thursday 05 October 2006 14:09, Andrea Righi wrote:
> Patrick Dowler wrote:
> > Is there any  way to have SystemConfigurator configure the NIC that is
> > actually used as eth0?

> SystemConfigurator can configure only the interface used to image your
> clients.

On the system I ran into this issue, there is a onboard forcedeth device and a 
PCI e1000 device. These get assigned eth0 and eth1 respectively by the 
aliases SC puts into modprobe.conf; in my case it made 

alias eth0 forcedeth
alias eth1 e1000

despite only e1000 in use during autoinstall. It also created ifcfg-eth1 (with 
ONBOOT=no) and either either editted (or not) ifcfg-eth0 (with ONBOOT=yes) 
but I can't tell because the golden client has the same ifcfg-eth0 file.

So, SC does not get modprobe.conf and the ifcfg-eth* files in a working state.
Presumably some kind of hardware probe returns devices in some order and that 
is what ends up in the above alias assignments... 
 
In a post-install script, I can tell which device is in use, but I don't see 
how to tell which driver that is. If I knew that, I could either fix the 
modprobe.conf to assign the right driver to eth0, or I could figure out which 
interface will work and fiddle the ifcfg-eth* files appropriately. But in  
either case I need to know which driver is in use and both are loaded on 
systems with both NICs. The hard way is to get the device+driver from 
modprobe, force both down (ifdown), then bring them up one at a time and see 
if dhcp can get an address. The one that gets an address is plugged in and 
then I know which device and driver will work.... Am I missing something? It 
seems SI must have already done that, but I didn't see it in variables.txt


> Anyway, you can use post-install scripts to properly setup your
> different network cards and produce the right ifcfg-eth[01].
>
> Remember that you can use $IPADDR, $NETMASK, $GATEWAY, etc. variables in
> your post-install scripts if you do a source of the file
> /tmp/post-install/variables.txt. For example your post-install script
> could look like the following (maybe this could help):
>
> ---------------------
> #!/bin/sh
> # Description: post-install script to properly configure network
> # interfaces
>
> . /tmp/post-install/variables.txt
>
> # Use installation IP address and netmask for eth0
> cat << "EOF" > /etc/sysconfig/network/ifcfg-eth0
> ONBOOT=yes
> IPADDR=$IPADDR
> NETMASK=$NETMASK
> ...
> EOF
>
> # Exit if eth1 doesn't exist
> ifconfig eth1 >/dev/null 2>&1 || exit 0
>
> # Evaluate IPADDR and NETMASK for eth1
> evaluate_eth1_ip $IPADDR
> IPADDR=$?
> evaluate_eth1_netmask $NETMASK
> NETMASK=$?
>
> # Configure eth1
> cat << "EOF" > /etc/sysconfig/network/ifcfg-eth1
> ONBOOT=yes
> IPADDR=$IPADDR
> NETMASK=$NETMASK
> ...
> EOF
>
> evaluate_eth1_ip()
> {
>     ip=$1
>     apply_some_regexp_on_ip
>     return $ip
> }
>
> evaluate_eth1_netmask()
> {
>     netmask=$1
>     apply_some_regexp_on_netmask
>     return $netmask
> }
> ---------------------
>
> Cheers,
> -Andrea

-- 

Patrick Dowler
Tel/Tél: (250) 363-6914                  | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre   | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada                  | Gouvernement du Canada
5071 West Saanich Road               | 5071, chemin West Saanich
Victoria, BC                                  | Victoria (C.-B.)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to