Network Functionality

only for RuBoard - do not distribute or recompile

Network Functionality

If you are going to use this system on the Internet, you need to set up a small local area network. The smallest practical local area network you can have is two computers connected to a small hub with 10BaseT connecting cable. You will also need two network cards that are supported by Windows and Linux.

NOTE

Actually, if you get what is called a crossover cable, you can connect the two machines directly to each other. However, this network cannot be expanded. It will be limited to only two machines.


Everything required can be purchased at a local computer store. Most of the smaller shops can help you set up the Windows machine. You need to choose a network card that is supported by Red Hat Linux for your server. Most 3Com or NE2000 compatible cards are supported by Linux.

It is beyond the scope of this book to go into the details of installation of various network cards. If you installed Red Hat Linux before you installed your network card, the best thing to do is to reinstall Red Hat Linux, choosing the Server option. If it recognizes your network card, it will ask you to fill out the IP address information for the card. If it does not recognize the card, that part of the install will be skipped .

If you will be setting up a small local area network, you need to read the next two sections. I show you how to pick the IP addresses and names you will give your machines. After you have gone through this exercise, you will have the general information necessary to set up a private network of practically any size .

General Network Connectivity Guidelines

You must assign unique IP addresses to each machine on an IPV4 network that hosts Internet services such as Web pages. If you are connected to the Internet, you must have your addresses assigned to you. If you are on a private network, you get to choose your addresses.

Three sets of addresses are reserved for private networks:

 10.0.0.0 through 10.x.x.x (where x is anything from 0 to 255) 172.16.0.0 through 172.31.x.x 192.168.0.0 through 192.168.x.x 

These addresses fall into the three classes of IPV4 address ranges available on the Internet. After you have chosen a set of addresses, all machines on your local network must use the same netmask and network address set, with unique IP address numbers for each machine.

EXCURSION: Internet IP Addressing

The IPV6 networking scheme will arrive within a few years , and will allow over 3,000 addresses per square meter of earth's surface. It will require changes in current TCP/IP stacks. These changes, for the most part, have already been made in all currently produced operating systems.

NOTE

IPV4 is pronounced eye pee vee four.

TCP/IP is pronounced tee cee pee eye pee.


Three classes of network addresses exist in the IPV4 TCP/IP addressing scheme. These network classes are called A, B, and C, and they allow easy configuration of routing schemes between networks. The number of machines you are deploying on the network determines the class of addressing you will use; it can also be referred to as the addressing range.

The first address range is called a class A address. You have almost 16,777,216 addresses from which to choose.

NOTE

This value is calculated from 256x256x256. Two hundred and fifty six possible address values are in each dotted section, called a quad.


It has a class A netmask value of 255.0.0.0.

The second address range is called a class B address. You have almost 65,536 addresses from which to choose.

NOTE

The value is calculated from 256x256.


It has a class B netmask value of 255.255.0.0.

The third address range is called a class C address. You have almost 256 addresses from which to choose. It has a class C netmask value of 255.255.255.0.

You don't have all the addresses to choose from in any of the address classes because of how two of the address values in a network are used. These two addresses play significant roles in network design.

One of the numbers used is 0. It denotes the base network in the netmask value. No machine can have an IP address of 0 if it coincides with the 0 in the netmask.

The other number is 255. No machine can have an IP address that contains 255 because 255 is reserved for the broadcast address on a network. All machines will receive any message sent to address 255 on the local network.

This 255 must be within the 0 part of the network mask. For example, let's assume the network is 192.168.1.0. Every machine on the network has three numbers in common: 192.168.1. Each machine has a unique last number, from 1 “254. For example, one machine could have an IP address of 192.168.1.10, and another one could have an IP address of 192.168.1.20. You cannot give two different computers the same IP address. Each machine on a network must have a unique address.

Testing Your Network Connection

To connect your machine to a network, you must connect one end of one 10BaseT cable to one computer and the other to the hub. Do the same for the other computer. Most hubs have an uplink port. This port is used to connect two hubs together without using an uplink cable. Do not use this port!

Now you must assign IP addresses to each machine. I picked two numbers from the 172.16.1.0 network. I decided to name my Windows machine win, and my Linux machine lin. The address of the Windows machine is 172.16.13.66, and the address of the Linux machine is 172.16.13.70. These decisions were arbitrary. Now you are ready to set up a local method of resolving machine names to IP addresses.

On the Windows machine, you need to edit the c:\windows\hosts file. If it does not exist, create it. In that file put the IP addresses and the names of the machines. Your file will look something like this:

 127.0.0.1       localhost                    # the loopback adaptor address 172.16.13.66    win  win.mydomain.com        # our test name 172.16.13.70    lin  lin.mydomain.com        # the Linux test name 

On the Linux machine, edit the /etc/hosts file and place the same type of information in it. It will look like this:

 127.0.0.1       localhost.mydomain.com localhost 172.16.13.70    lin winbook lin.mydomain.com 172.16.1.66     win wmaxlaptop win.mydomain.com 

Note that you can refer to the Linux machine as lin or winbook. When the TCP/IP stack looks up the machine name from the address (called a reverse lookup), the name returned will be lin because it is first in the list.

Bring up a DOS prompt on the Windows machine, and run the command ping lin. You should see something similar to the following:

C:\WINDOWS>ping lin

Output

 Pinging lin [172.16.13.70] with 32 bytes of data: Reply from 172.16.13.70: bytes=32 time=21ms TTL=255 Reply from 172.16.13.70: bytes=32 time=2ms TTL=255 Reply from 172.16.13.70: bytes=32 time=1ms TTL=255 Reply from 172.16.13.70: bytes=32 time=1ms TTL=255 Ping statistics for 172.16.13.70:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:     Minimum = 1ms, Maximum =  21ms, Average =  6ms 

Your ping times should be much better. I am running Windows under VMWare on my laptop, which makes the ping times longer.

On your Linux machine, bring up a terminal window and run the command ping -c 5 win. This will provide a provide a printout similar to this:

[root root@winbook]#ping -c 5 win

Output

 PING win (172.16.13.66) from 172.16.13.70 : 56(84) bytes of data. 64 bytes from 172.16.13.66: icmp_seq=0 ttl=128 time=7.3 ms 64 bytes from 172.16.13.66: icmp_seq=1 ttl=128 time=0.8 ms 64 bytes from 172.16.13.66: icmp_seq=2 ttl=128 time=1.8 ms 64 bytes from 172.16.13.66: icmp_seq=3 ttl=128 time=0.9 ms 64 bytes from 172.16.13.66: icmp_seq=4 ttl=128 time=1.2 ms --- win ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.8/2.4/7.3 ms 

If you don't get these results, something is wrong with your network setup. You might need to get someone who has set up small networks to help you. You cannot expect to log on to your Linux server from your Windows machine and use any services until this works.

If you want to continue on a standalone basis, without network support, you can. However, the ping of the loopback adapter must work.

only for RuBoard - do not distribute or recompile


MySQL and PHP From Scratch
MySQL & PHP From Scratch
ISBN: 0789724405
EAN: 2147483647
Year: 1999
Pages: 93
Authors: Wade Maxfield

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net