Jonathan's Contribution

Linux Configuration

Gateway's Network Configuration


[Home] [Up] [Prev] [Next]

Note that name serving (referencing hosts by names rather than numbers) will remain broken until name serving on Gateway and Henry are setup.

What do we want to achieve?

Some background notes
 
References

Network Configuration Files

HOSTNAME
>>>>>>>>>>>>>>>>>>>>/etc/HOSTNAME
gateway.novatek.co.nz
<<<<<<<<<<<<<<<<<<</etc/HOSTNAME
 
hosts
>>>>>>>>>>>>>>>>>>>/etc/hosts
127.0.0.1               localhost.localdomain localhost
<<<<<<<<<<<<<<<<<</etc/hosts
Only include the localhost in the hosts file.  All names to ip address relations will be created using bind.
 
hosts.conf
>>>>>>>>>>>>>>>>>>>/etc/host.conf
order hosts,bind
multi on
<<<<<<<<<<<<<<<<<</etc/host.conf

I'm not sure if this is still required.  I think it is depreciated and replaced by nsswitch.conf, but I leave it in just incase.  It tells the name resolver to first look in the /etc/hosts file, be for making a dns request through bind, the name serving daemon.  The last line enables multiple domain names to be associated with an IP address.
 

resolv.conf
>>>>>>>>>>>>>>>>>>/etc/resolv.conf
domain novatek.co.nz
nameserver 192.168.0.3
<<<<<<<<<<<<<<<<<</etc/resolve.conf

We use henry (192.168.0.3) as our internal name server for the network. We should have a secondary internal DNS for security - perhaps some time in the future.  Note that name serving is not going to work properly until both Gateway's and Henry's name serving is set up.
 

nsswitch.conf
>>>>>>>>>>>>>>>>>>>>/etc/nsswitch.conf
passwd:     files nisplus nis
shadow:     files nisplus nis
group:      files nisplus nis
hosts:      files nisplus nis dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files
netgroup:   nisplus
publickey:  nisplus
automount:  files nisplus
aliases:    files nisplus
<<<<<<<<<<<<<<<<<<<</etc/nsswitch.conf

The important line in this file is  hosts:      files nisplus nis dns. This file gives instructions to the resolver to first look in files (/etc/hosts), then nis before dns.  Because we are not installing nis, if a host name is not found in the /etc/hosts file, it will be looked up using DNS (Domain Name Server).
 

RedHat's sysconfig stuff
These files define environment variables used by RedHat's startup scripts.  (See  RedHat's Reference Guide, section on Boot Process, Init and Shutdown.  Also it is worthwhile reading the startup scripts /etc/rc.d/init.d/network, /etc/sysconfig/network-scripts/ifup, /etc/sysconfig/network-scripts/ifup-aliases).

>>>>>>>>>>>>>>>>>>>>/etc/sysconfig/network

NETWORKING=yes
FORWARD_IPV4=true
HOSTNAME=`cat /etc/HOSTNAME`
GATEWAY=24.113.94.1
GATEWAYDEV=eth0
<<<<<<<<<<<<<<<<<<<</etc/sysconfig/network

>>>>>>>>>>>>>>>>>>>>/etc/sysconfig/network/scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=24.113.94.87
NETMASK=255.255.254.0
ONBOOT=yes
NETWORK=24.113.94.0
#BROADCAST=24.113.95.255
USERCTL=no
<<<<<<<<<<<<<<<<<<<</etc/sysconfig/network/scripts/ifcfg-eth0

>>>>>>>>>>>>>>>>>>>>/etc/sysconfig/network/scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.254
NETMASK=255.255.255.0
ONBOOT=yes
NETWORK=192.168.0.0
#BROADCAST=192.168.0.255
USERCTL=no
<<<<<<<<<<<<<<<<<<<</etc/sysconfig/network/scripts/ifcfg-eth1

>>>>>>>>>>>>>>>>>>>/etc/sysconfig/network-scripts/ipcfg-eth0-range0

IPADDR_START=24.113.98.164
IPADDR_END=24.113.98.164
CLONENUM_START=0
<<<<<<<<<<<<<<<<<<</etc/sysconfig/network-scripts/ipcfg-eth0-range0
Read the header of /etc/sysconfig/network-scripts/ifup-aliases for an explaination.
After  changing HOSTNAME, it is necessary to reboot (with shutdown now) for the changes to take effect.
 
When the system has booted, check that networking is working.  Issue the following commands, and observe the corresponding results:
 
ifconfig should give:
------------------------------------------
eth0      Link encap:Ethernet  HWaddr 00:00:E8:D3:D7:65
   inet addr:24.113.94.87  Bcast:24.113.95.255  Mask:255.255.254.0
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:7246090 errors:0 dropped:0 overruns:0 frame:5
   TX packets:93356 errors:0 dropped:0 overruns:0 carrier:0
   collisions:1080 txqueuelen:100
   Interrupt:12 Base address:0x240

eth0:0    Link encap:Ethernet  HWaddr 00:00:E8:D3:D7:65
   inet addr:24.113.98.164  Bcast:24.113.95.255  Mask:255.255.254.0
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   Interrupt:12 Base address:0x240

eth1      Link encap:Ethernet  HWaddr 00:00:E8:D3:D9:C0
   inet addr:192.168.0.254  Bcast:192.168.0.255  Mask:255.255.255.0
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:174241 errors:1 dropped:28 overruns:0 frame:7
   TX packets:184165 errors:0 dropped:0 overruns:0 carrier:0
   collisions:178 txqueuelen:100
   Interrupt:11 Base address:0x300

lo        Link encap:Local Loopback
   inet addr:127.0.0.1  Mask:255.0.0.0
   UP LOOPBACK RUNNING  MTU:3924  Metric:1
   RX packets:2565 errors:0 dropped:0 overruns:0 frame:0
   TX packets:2565 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
------------------------------------------

route -n should give:
This has changed, commenting out the BROADCAST variables in the ifcfg-eth files correct the routing table entries.

------------------------------------------
Kernel IP routing table
Destination     Gateway        Genmask         Flags Metric Ref    Use Iface
24.113.98.164   0.0.0.0        255.255.255.255 UH    0      0        0 eth0
192.168.0.254   0.0.0.0        255.255.255.255 UH    0      0        0 eth1
24.113.94.87    0.0.0.0        255.255.255.255 UH    0      0        0 eth0
127.0.0.1       0.0.0.0        255.255.255.255 UH    0      0        0 lo
192.168.0.0     0.0.0.0        255.255.255.0   U     0      0        0 eth1
24.113.98.0     0.0.0.0        255.255.254.0   U     0      0        0 eth0
24.113.94.0     0.0.0.0        255.255.254.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0        255.0.0.0       U     0      0        0 lo
0.0.0.0         24.113.94.1    0.0.0.0         UG    0      0        0 eth0
------------------------------------------

 
Pinging an IP address (not names, they are broken until we fix DNS) on the internet and the local network should give results.

We now have ethernet and TCP/IP working, now on to name serving.
 

 
 

[Home] [Up] [Prev] [Next]

Last modified: Tue Feb 8 22:00:00 PST 2000
Copyright © Jonathan Marks, 1999, 2000. All rights reserved.
http:/www.novatek.co.nz/linux/config/gateway-net.html