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?
- On the external interface (facing the internet) Gateway wants to be recognized by the two ip addresses:
- 24.113.94.87 (for novatek.co.nz)
- 24.113.98.164 (for cmex.org)
- The local network is recognised by 192.168.0.254, and is the gateway for the local network.
- We are connected through our ISP's gateway 24.113.94.1 to the outside world.
- Until our name serving is setup we will use our ISP's name server's 24.2.10.33 and 24.2.10.34.
- Some background notes
- Name serving (referencing hosts by names rather than numbers) will remain broken until name serving on Gateway and Henry are setup.
- This configuration is very Redhat distribution dependant.
- Do not use the configuration tools such as netcfg, control-panel, linuxconf. This is a "real" configuration exercise, not for the meek who cower behind gui tools!
- References
- Net-HOWTO
- RedHat's Reference Guide, Ch 2 on Boot Process, Init and Shutdown.
- LDP's Network Administration Project, Ch's on Issues of TCP/IP networking and Configuring TCP Networking. A bit dated, and "Slackware-ish", but insightful, none the less.
Network Configuration Files
- HOSTNAME
- >>>>>>>>>>>>>>>>>>>>/etc/HOSTNAME
gateway.novatek.co.nz<<<<<<<<<<<<<<<<<<</etc/HOSTNAME
- hosts
- >>>>>>>>>>>>>>>>>>>/etc/hosts
127.0.0.1 localhost.localdomain localhost<<<<<<<<<<<<<<<<<</etc/hostsOnly include the localhost in the hosts file. All names to ip address relations will be created using bind.
hosts.conf>>>>>>>>>>>>>>>>>>>/etc/host.conf
resolv.conforder hosts,bind multi on<<<<<<<<<<<<<<<<<</etc/host.confI'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.
>>>>>>>>>>>>>>>>>>/etc/resolv.conf
nsswitch.confdomain novatek.co.nz nameserver 192.168.0.3<<<<<<<<<<<<<<<<<</etc/resolve.confWe 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.
>>>>>>>>>>>>>>>>>>>>/etc/nsswitch.conf
RedHat's sysconfig stuffpasswd: 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.confThe 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).
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).
When the system has booted, check that networking is working. Issue the following commands, and observe the corresponding results:>>>>>>>>>>>>>>>>>>>>/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.
Pinging an IP address (not names, they are broken until we fix DNS) on the internet and the local network should give 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-ethfiles 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 ------------------------------------------
We now have ethernet and TCP/IP working, now on to name serving.
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