Server IP address configuration Next Previous Contents

2. Step One

The following steps are basically setting your IP address and the network on which you want to be on. This is for a Class C network address, which is probably what you want. (If you are unsure, this link (http://www.intercom.net/help/tutor/ipexpl.html) should prove useful.)

2.1 Configuring your server's IP address

At the command line, as root, issue these two commands:

ifconfig eth0 up 192.168.0.1 netmask 255.255.255.0

route add -net 192.168.0.0 netmask 255.255.255.0 eth0

You can check what you have done by typing ifconfig -a and it should read somewhat similar to:

[root@Server public]# ifconfig -a

You can also check what you have done by typing route and it should read somewhat similar to (sorry if it looks funky :-)

[root@Server public]# route


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
209.212.127.10  0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.1     0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.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         209.212.127.10  0.0.0.0         UG    0      0        0 ppp0

Explanation:
(1st line) 209.212.127.10 is my current IP address given to me by my ISP.
(2nd line) 192.168.0.1 is set as the IP address of the current computer, as indicated by UH.
(3rd line) 192.168.0.0 is the network that I'm currently on, indicated by the U.
(4th line) 127.0.0.0 is my loopback.. don't need to worry about that.. just make sure it's there.. then
(5th line) 0.0.0.0 is my GATEWAY(->209.212.127.10), as indicated by the UG.

If you get the error: Connection timed out (or similiar.. from a ping, etc) it could be because you have two default gateways set. Ripped from Microsoft: This requirement is a result of the basic architecture of TCP/IP. Only one default gateway must be defined on a host that resides on 2 or more non-connected networks. Which basically means that for every NETWORK you are on (such as 192.168.0.0) you must have only ONE default gateway. If you have two default gateways, the TCP/IP stack will assume that they lead to the same set of networks; which will cause the server to send Internet traffic to the internal network, *or* internal traffic to the Internet. Overall, you should _not_ have two default gateways. If you are unsure what a default gateway is, think about it in terms of "an entrance point to another network" or a "default route" to something - whereas if you set your windows computer (manually) for a default gateway to 192.168.0.1, it provides it with *an entrance point* to that target computer. In the same respect, if, on your server, you set your default gateway (which is automatically set if you use WvDial) to that of your ISP, it provides your server with *an entrance point* to that target computer (or network). Now, imagine every router in the world, all with different gateways, all "daisy-chained" together, per se, and this, is the internet. When you send a request out to a random site on the internet, it first goes to your ISP, and determines if the IP address is on their network, if it isn't, it is automatically passed to *its* default gateway, then, that router checks to see if it is on its network, if it isn't, it passes it to *its* default gateway, and so on, until it finally finds the right router on which the network that the IP address is connected to. That is just some general knowledge to know; what you should know about a default gateway is that in order to pass information *outside* your network, you must specify one default gateway (which usually ends up being located on your server, which is pointing to your ISP).


Next Previous Contents