Home

configure_network




Purpose

configure_network is a simple script to configure the network adapter according to the values of the nvramrc variable network-boot-arguments.

The nvramrc variable network_boot_arguments is used for WANBOOT on SPARC machines.



Back to top

License


# CDDL HEADER START
#
# The contents of this file and the script are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END


Back to top

History


Version
Releasedate
Description
1.0.0
07.11.2009
#   07.11.2009 v1.0.0 /bs
#       initial release for the Extended MilaX WANBOOT image v1.0.0
1.0.1
09.11.2009 v1.0.1 /bs #   09.11.2009 v1.0.1 /bs
#       new version for the Extended MilaX WANBOOT image v1.0.1
#           added code to plumb the network adapter
#           added code to handle multiple net aliase








Back to top

Operating system

Solaris 9 and newer; SPARC systems only


Back to top

Language / type

Shell script


Back to top

Prerequisites

The nvramrc variable network-boot-arguments must be set, e.g.:

bash-3.00$ /usr/sbin/eeprom network-boot-arguments
network-boot-arguments=host-ip=192.168.1.5,router-ip=192.168.1.1,subnet-mask=255.255.255.0,hostname=v240,client-id=C0A80105,file=http://192.168.1.246/cgi-bin/wanboot-cgi




Back to top

Usage


    configure_network


To use it in a boot image (e.g. for WANBOOT or for failsafe booting) copy the script to /etc/init.d and create a symbolic link in the directory /etc/rc3.d; e.g.

    root@v240:/tmp/milax# ls -l etc/rc3.d/S90configure_network
    lrwxrwxrwx   1 root     root          27 Nov  9 19:32 etc/rc3.d/S90configure_network -> ../init.d/configure_network


Examples:

# ifconfig bge0
ifconfig: status: SIOCGLIFFLAGS: bge0: no such interface

# eeprom network-boot-arguments
network-boot-arguments=host-ip=192.168.1.5,router-ip=192.168.1.1,subnet-mask=255.255.255.0,hostname=v240,client-id=C0A80105,file=http://192.168.1.246/cgi-bin/wanboot-cgi
 
# /tmp/milax/etc/init.d/configure_network
Configuring the network ...
+ ifconfig bge0 plumb 192.168.1.5 netmask 255.255.255.0 broadcast + up
ifconfig: SIOCSLIFNAME for ip: bge0: already exists
+ route add default 192.168.1.1
add net default: gateway 192.168.1.1
+ set +x
Configuring the nodename ...

# ifconfig bge0
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.1.5 netmask ffffff00 broadcast 192.168.1.255
        ether 0:3:ba:52:7d:5


The script does nothing if the network adapter is already configured:

root@v240:/# /tmp/milax/etc/init.d/configure_network
ifconfig: SIOCSLIFNAME for ip: bge0: already exists
Network adapter bge0 already configured:
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.1.5 netmask ffffff00 broadcast 192.168.1.255
        ether 0:3:ba:52:7d:5
Nothing to do here
Configuring the nodename ...
/etc/hosts already configured.


  


Back to top

Configuration & Internas


Nothing special -- the script just reads the nvramrc variable network-boot-arguments and configures the network adapter with the values from this variable. The network adapter to configure is the network adapter that is configured in the nvramrc adpater "net".



Back to top

Notes

The script is used in the Extended MilaX WANBOOT image:

Converting the MilaX Live CD for SPARC to a WANBOOT image



Back to top

Download


Download configure_network



Back to top