[Server-devel] eth0 statii IP
Tim Moody
timmoody at sympatico.ca
Thu Jul 3 12:09:36 EDT 2008
On startup /etc/rc.d/init.d/olpc-network-config (which points to
/fsroot.olpc/etc/init.d/olpc-network-config) runs and, as Tony says, checks
for the existence of /etc/sysconfig/olpc_net_config.
If it doesn't find that file it runs
/etc/sysconfig/olpc-scripts/network_config (which points to
/fsroot.olpc/etc/sysconfig/olpc-scripts/network_config). I have the
impression that /fsroot.olpc/etc/sysconfig/olpc-scripts/network_config can
be run by other configuration scripts as well.
/fsroot.olpc/etc/sysconfig/olpc-scripts/network_config closes the loop by
creating /etc/sysconfig/olpc_net_config, but ONLY if it succeeds. It will
fail if there are more than two wired ethernet adapters (or none); I have
three so it always fails.
It copies /fsroot.olpc/etc/sysconfig/olpc-scripts/ifcfg-eth0, etc to
/etc/sysconfig/network-scripts. My approach to the problem of not losing
the eth0 static IP address was to modify
/fsroot.olpc/etc/sysconfig/olpc-scripts/ifcfg-eth0 as follows rather than
just creating /etc/sysconfig/olpc_net_config.
# OLPC School server
# This file configures the ethernet port connected to the Internet (WAN)
DEVICE=eth0
ONBOOT=yes
# Sometimes, a static address is assigned
IPADDR=192.168.0.160
#IPV6ADDR=2001:4830:2446:ff00::2/64
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
# These defines are used to request a dynamic address [or not]
BOOTPROTO=none
DHCP_HOSTNAME=schoolserver
# This is tied to a particular ethernet interface
That way even if something causes
/fsroot.olpc/etc/sysconfig/olpc-scripts/network_config to run, the static IP
config is not lost.
> ------------------------------
>
> Message: 2
> Date: Tue, 1 Jul 2008 07:04:39 -0700
> From: Tony Pearson <tpearson at us.ibm.com>
> Subject: [Server-devel] eth0 static IP requires
> /etc/sysconfig/olpc_net_config
> To: server-devel at lists.laptop.org
> Cc: Phill Hardstaff <phillh at spc.int>
> Message-ID:
> <OF27D1315A.E43714CA-ON87257479.004CCFE7-07257479.004D5137 at us.ibm.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
>> From: "Martin Langhoff" <martin.langhoff at gmail.com>
>> Subject: Re: [Server-devel] Laptop XS working
>> To: "Phill Hardstaff" <phillh at spc.int>
>
>> The XS has (or should have) 2 network interfaces.
>
>> - eth0 is the internet / wan connection. It defaults to doing dhcp,
>> if you need to set it to a static ip address, edit
>> /etc/sysconfig/network-scripts/ifcfg-eth0
>
> Phil,
> For static IP you also need to create a file, which I did as
> follows:
>
> [root ~]# echo "# created by Tony" > /etc/sysconfig/olpc_net_config
>
> It doesn't matter what the contents are, however, XS checks for this file,
> and if it doesn't exist,
> copies over your ifcfg-eth0 with pre-defined DHCP ones. The original idea
> I presume was that
> after it copies over the DHCP it would create this file to turn off the
> process and only do it on the
> first boot, but in my case, that file never got created, and all my work
> setting up static IP was
> over-written each time. Creating this file solved the problem.
>
> Martin, would you like me to file a "bug" on this?
>
> Tony
>
>
>
>
> Tony Pearson
> Senior Storage Consultant, IBM System Storage?
> Telephone: +1 520-799-4309 | tie 321-4309 | Cell: +1 520 990-8669
> email: tpearson at us.ibm.com | GSA: http://tucgsa.ibm.com/~tpearson
> Blog: http://www.ibm.com/developerworks/blogs/page/InsideSystemStorage
> AKA: 990tony Paravane, eightbar specialist
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.laptop.org/pipermail/server-devel/attachments/20080701/3737feda/attachment-0001.htm
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: image/jpeg
> Size: 3808 bytes
> Desc: not available
> Url :
> http://lists.laptop.org/pipermail/server-devel/attachments/20080701/3737feda/attachment-0001.jpeg
>
> ------------------------------
>
> _______________________________________________
> Server-devel mailing list
> Server-devel at lists.laptop.org
> http://lists.laptop.org/listinfo/server-devel
>
>
> End of Server-devel Digest, Vol 15, Issue 2
> *******************************************
More information about the Server-devel
mailing list