Use Customized Scripts To Configure NIC
If using customized script to configure NIC, niccustomscripts for the specified nic in nics table should be configured. In the customized scripts, it can use data from xCAT DB, These data are parsed as global value from /xcatpost/mypostscript in compute node. Here is a simple example :
Compute node
cn1with one physical NIC:eth1Put customized script
cfgeth1under xCAT MN/install/postscripts
- Configure
niccustomscriptsinnicstable ::chdef cn1 niccustomscripts.eth1=cfgeth1
The script
cfgeth1uses data from xCAT DB, for example, it uses networknet50fromnetworkstablechdef -t network net50 net=50.0.0.0 mask=255.0.0.0Notes: The network
net50is parsed asNETWORKS_LINE1in/xcatpost/mypostscriptas following, so scriptcfgeth1can use global valueNETWORKS_LINE1directlyNETWORKS_LINE1='netname=net50||net=50.0.0.0||mask=255.0.0.0||mgtifname=||gateway=||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='When
confignetworkis running incn1,confignetworkwill executecfgeth1to configure eth1, so addingconfignetworkinto the node’s postscripts list. During OS deployment on compute node,confignetworkpostscript will be executed.chdef cn1 -p postscripts=confignetworkOr if the compute node is already running, use
updatenodecommand to runconfignetworkpostscript without rebooting the node:updatenode cn1 -P confignetworkUse
xdsh cn1 "ip addr show eth1"to check the NICCheck
ifcfg-eth1under/etc/sysconfig/network-scripts/