Minix with a static IP address
When Minix 3 is installed it defaults to using DHCP to obtain an IP address and DNS server information. With the move of this weblog to a dedicated server I was given a static IP address and couldn't use DHCP. Here's how I set up Minix to run with a static IP address.
I installed Minix as normal but did not get an IP address since there is no DHCP server running on the network. Minix decides whether to use DHCP or not from the existance of an '/etc/rc.net' file. If it does not exist, the following steps are performed (this is all in '/usr/etc/rc'):
By creating an '/etc/rc.net' file these steps are not done, instead it is expected that '/etc/rc.net' will do what is necessary to get the network up and running. I created an '/etc/rc.net' that looked like the following:
The first things it does is run 'ifconfig' to set the IP address. Replace 'my.ip.address.here' with the dotted IP number. This is followed by an 'add_route' to set the gateway for the network. Again, 'my.gateway.address.here' is replaced by the gateway dotted IP address. Both of these IP addresses were provided by my hosting company.
The 'nonamed' daemon still needs to be run and so does the 'rc.daemons' script. This won't happen if 'rc.net' exists so it's done manually within the new 'rc.net'.
Once final step is to tell Minix the IP address of the nameservers. This can be done using 'nonamed' by adding something like the following to '/etc/hosts':
Replace '192.168.1.10', etc with the IP address of the nameservers as given to you by the hosting provided. Usually '/etc/hosts' holds local domain name lookup information. The '%nameserver' is a special directive used by 'nonamed' to tell it what the IP addresses of the nameservers are. Usually it gets this from the DHCP configuration. Without DHCP it needs to be done manually.
If you don't run 'nonamed' you can set the nameserver information differently by adding it to '/etc/resolv.conf'. In that case the file would look like:
Again, you'd replace the IP addresses with the proper nameserver ones. Without 'nonamed' this will use the network nameservers directly.
If you use 'nonamed' you should not have a '/etc/resolv.conf', instead using the '/etc/hosts' method described above. 'nonamed' is essentially a local nameserver that delegates to the network ones but has some additional benenfits like caching, etc. From the man page:
Once these steps are done you can bring the network up by rebooting, or running:
You'll now have the static IP address and access to the network.
Categories: minix, networking, admin
I installed Minix as normal but did not get an IP address since there is no DHCP server running on the network. Minix decides whether to use DHCP or not from the existance of an '/etc/rc.net' file. If it does not exist, the following steps are performed (this is all in '/usr/etc/rc'):
- Run the 'dhcpd' daemon to obtain an IP address.
- Run the 'nonamed' daemon for DNS queries.
- Run '/etc/rc.daemons' if it exists.
By creating an '/etc/rc.net' file these steps are not done, instead it is expected that '/etc/rc.net' will do what is necessary to get the network up and running. I created an '/etc/rc.net' that looked like the following:
ifconfig -I /dev/ip0 -n 255.255.255.0 -h my.ip.address.here
add_route -g my.gateway.address.here
daemonize nonamed -L
. /etc/rc.daemons
The first things it does is run 'ifconfig' to set the IP address. Replace 'my.ip.address.here' with the dotted IP number. This is followed by an 'add_route' to set the gateway for the network. Again, 'my.gateway.address.here' is replaced by the gateway dotted IP address. Both of these IP addresses were provided by my hosting company.
The 'nonamed' daemon still needs to be run and so does the 'rc.daemons' script. This won't happen if 'rc.net' exists so it's done manually within the new 'rc.net'.
Once final step is to tell Minix the IP address of the nameservers. This can be done using 'nonamed' by adding something like the following to '/etc/hosts':
192.168.1.10 %nameserver
192.168.1.11 %nameserver
Replace '192.168.1.10', etc with the IP address of the nameservers as given to you by the hosting provided. Usually '/etc/hosts' holds local domain name lookup information. The '%nameserver' is a special directive used by 'nonamed' to tell it what the IP addresses of the nameservers are. Usually it gets this from the DHCP configuration. Without DHCP it needs to be done manually.
If you don't run 'nonamed' you can set the nameserver information differently by adding it to '/etc/resolv.conf'. In that case the file would look like:
nameserver 192.168.1.10
nameserver 192.168.1.11
Again, you'd replace the IP addresses with the proper nameserver ones. Without 'nonamed' this will use the network nameservers directly.
If you use 'nonamed' you should not have a '/etc/resolv.conf', instead using the '/etc/hosts' method described above. 'nonamed' is essentially a local nameserver that delegates to the network ones but has some additional benenfits like caching, etc. From the man page:
Nonamed is not a name daemon. It can answer simple queries from /etc/hosts, but anything else is relayed to a real name daemon. Nonamed maintaines a small cache of replies it has seen from a name daemon, and will use this cache to minimize traffic if the machine is permanently connected to the Internet, or to answer requests if the machine is often disconnected from the Internet, i.e. a computer at home.
Once these steps are done you can bring the network up by rebooting, or running:
. /etc/rc.net
You'll now have the static IP address and access to the network.
Categories: minix, networking, admin

0 Comments:
Post a Comment
<< Home