玄箱 Kuro Box Gentoo Kuro Box Gentoo
Help for users running Gentoo on the Kuro Box.
Home  |  About the Site  |  Contact Us

 

 

Installing Gentoo Beta 1 on the Kuro Box
<<  Return to table of contents


9. Configuring the Network

9. a. Configure the eth0 interface

This is a very important step too. I'm sure you don't want to have a box that doesn't reply to your SSH connection attempts once rebooted...

First we need to edit the file /etc/conf.d/net to tell Linux about the network settings we wish to use on the Ethernet port of our Kuro Box. All you have to do is to set a static IP if you use static IP, or to set it to DHCP mode if you have a DHCP server. I use DHCP, thanks to my small Linksys router. If you use a static IP, you'll probably need to uncomment and alter the default gateway entry near the bottom of this file.

So when you edit this file, you need to decide whether your Kuro Box will have a statically assigned IP address or whether the Kuro Box will get it's IP address from a DHCP server. If you decide to use DHCP, it is a good idea to assign the Kuro Box a fall back address in case the DHCP is not responding.

If you plan to use DHCP, uncomment the lines shown below in green and customize the fallback info to suit your network.
If you plan to use a static address, uncomment the purple lines and customize the settings for your network.

Make sure that only one section is uncommented. The other section should be commented out with # characters.

/etc/conf.d/net
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
#
#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
dhcpcd_eth0="-N"

# If you want to use DHCP and have a fallback in case your Kurobox does a hard
# power cycle (a few of us have had problems with this) use this setup instead
ifconfig_eth0=( "dhcp" )
dhcpcd_eth0="-d -t 10"
ifconfig_fallback_eth0=( "192.168.0.100 broadcast 192.168.0.255 netmask 255.255.255.0" )
routes_eth0=( "default gw 192.168.0.1" )

# end of optional DHCP fallback config

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway
#
#gateway="eth0/192.168.0.1"
Notes: DHCP is active in the example above. The fallback address has been set to 192.168.0.100 with a default gateway of 192.168.0.1

Then you must add this interface to your default startup scripts:

Make sure the ethernet interface is started at boot
KURO-BOX-EM etc # rc-update add net.eth0 default
* net.eth0 added to runlevel default
* Caching service dependencies...
* rc-update complete.
Notes:

9. b. Setting the hostname

Now, choose an hostname for your box. It will be "my-kurobox" for me:

Set the hostname
KURO-BOX-EM etc # echo my-kurobox > /etc/hostname
Notes:

And add this hostname to the /etc/hosts file:

/etc/hosts
# /etc/hosts: This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#

127.0.0.1 localhost my-kurobox
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Notes: add your hostname where the blue text is.

 


<<  Return to table of contents