Hi again.
I have these tricky things showing up all the time :)
I have looked here and there but I don't find the answer to this question:

/etc/udev/rules.d contains rules, but as they have persistent in the name I get 
suspicious.
and I don't fully understand how these rules are used and when

When a RHEL6 starts and activates the network adapter, does it know if it is 
layer 2 or 3 and
is that info used to update /etc/sysconfig/network-scripts/ifcfg-eth0 ?

It currently looks like this in a test server:

DEVICE="eth0"
BOOTPROTO="static"
DNS1="131.97.124.5"
DNS2="131.97.125.24"
DOMAIN="xxx.volvo.testnet"
GATEWAY="10.220.140.1"
IPADDR="10.220.140.2"
NETMASK="255.255.254.0"
NETTYPE="qeth"
NM_CONTROLLED="yes"
ONBOOT="yes"
OPTIONS="layer2=0"
SUBCHANNELS="0.0.0700,0.0.0701,0.0.0702"
TYPE="Ethernet"

Maybe we will switch to layer 2 later, and if so we want the servers to 
automagically configure itself.
Sofar it seems it does not, so the following script will be used at boot time ( 
/etc/rc.local ).
But after coding it I realized it might not be needed, or it might be... :)

As you see I have some extra exits still. Safetynet.

# Get the LAYER used from the z/VM system. Layer 2 = Ethernet with MAC-address, 
Layer 3 = IP-only
LAYER2='0'
vmcp q vswitch anytype > /root/temp_quewry_vswitch.txt
# set linenr to 0, we want to peek into line 2
linenr=`expr 1`
while read line
do
  if [ $linenr = "2" ]; then
    echo "linenr 2:"$line
    found_it=`echo $line | grep "Ethernet"`
    if [ "$found_it" = "" ]; then
      echo "Ethernet NOT found from VMCP QUERY VSWITCH ANYTYPE, this is LAYER 
3, IP-only"
      LAYER2='0'
    else
      echo "Ethernet FOUND from VMCP QUERY VSWITCH ANYTYPE, this is LAYER 2, 
with MAC address"
      LAYER2='1'
    fi
  fi
  linenr=`expr $linenr + 1`
done < /root/temp_quewry_vswitch.txt

echo 'DEVICE="eth0"'                             > /root/temp-ifcfg
echo 'BOOTPROTO="static"'                        >> /root/temp-ifcfg
echo 'DNS1="'$DNS1'"'                            >> /root/temp-ifcfg
echo 'DNS2="'$DNS2'"'                            >> /root/temp-ifcfg
echo 'DOMAIN="'$DOMAIN'"'                        >> /root/temp-ifcfg
echo 'GATEWAY="'$GATEWAY'"'                      >> /root/temp-ifcfg
echo 'IPADDR="'$IP'"'                            >> /root/temp-ifcfg
echo 'NETMASK="'$NETMASK'"'                      >> /root/temp-ifcfg
echo 'NETTYPE="qeth"'                            >> /root/temp-ifcfg
echo 'NM_CONTROLLED="yes"'                       >> /root/temp-ifcfg
echo 'ONBOOT="yes"'                              >> /root/temp-ifcfg
echo 'OPTIONS="layer2='$LAYER2'"'                >> /root/temp-ifcfg
echo 'SUBCHANNELS="0.0.0700,0.0.0701,0.0.0702"'  >> /root/temp-ifcfg
echo 'TYPE="Ethernet"'                           >> /root/temp-ifcfg

diff_output=`diff -q /root/temp-ifcfg /etc/sysconfig/network-scripts/ifcfg-eth0`
echo "diff_output="$diff_output
if [ "$diff_output" = "" ]; then
  log_info 'IPconfig same as before, no change and no network restart.'
  exit 0  # 
else
  log_info 'IPconfig is changed.'
  exit 0  # 
  cp /root/temp-ifcfg /etc/sysconfig/network-scripts/ifcfg-eth0 
  log_info 'Created a new /etc/sysconfig/network-scripts/ifcfg-eth0 , will 
restart the network now.'
  service network restart
fi


Cordialement / Vriendelijke Groeten / Best Regards / Med Vänliga Hälsningar
  Tore Agblad
________________________________________________
Tore Agblad
System programmer, Volvo IT certified IT Architect
Volvo Information Technology
Infrastructure Mainframe Design & Development, Linux servers
Dept 4352  DA1S
SE-405 08, Gothenburg  Sweden
Telephone: +46-31-3233569
E-mail: [email protected]
http://www.volvo.com/volvoit/global/en-gb/

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to