Things to Look at When You Can t Connect

Things to Look at When You Can't Connect

Your computer's connection to an IP network is primarily defined by two things: the IP address and the netmask . If either one of these values is anything other than 100% perfect, your IP connection will not work.

First, determine which LAN (Local Area Network) interface you are attempting to connect through using the netstat command. As the name suggests, the netstat utility is used to determine the status of your network connections. Netstat implementations are different across the various Unix systems, but I am not aware (he said carefully ) of any variation which does not support the -r option, which yields routing information. Type in the following command:

 netstat -r 

That should return output similar to the following:

 Kernel IP routing table Destination    Gateway   Genmask        Plags   MSS    Window   irtt   Iface 192.251.100.0  *         255.255.255.0  U       1500   0        0      eth0 135.187.35.0   ^         255.255.252.0  U       1600   0        0      eth1 127.0.0.0      *         255.0.0.0      U       3584   0        0      lo default        odin      0.0.0.0        UG      1500   0        0      eth0 

In the leftmost column, locate the Destination to which you are attempting to send a packet. Continuing the example we started in the section on ping , we will be looking at the 192.251.100.0 Destination. Note that the Destination value does not exactly match the IP address of our target machine (192.251.100. 10 for the machine named loki, as opposed to a Destination value of 192.251.100. for loki's subnet. In IP addressing, a value of 0 is often used as a sort of wildcard.)

At any rate, once you have identified your subnet in the leftmost column, look in the Iface column to see which network interface you are using. In the example above, that would be eth0. Once you know the name of the interface, you can use the ifconfig command to determine its network properties.

 ifconfig eth0 

Implementations of the ifconfig command vary widely, but they will always include information on IP address, netmask, and whether or not the card is UP. Here is an example from Red Hat Linux 5.2:

 eth0   Link encap:Ethernet HWaddr 00:20:78:17:9A:EB        inet addr:192.251.100.1 Bcast:192.251.100.255 Mask:255.255.255.0        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1        RX packets:90 errors:0 dropped:0 overruns:0 frame:0        TX packets:1031 errors:0 dropped:0 overruns:0 carrier:0        collisions:0        Interrupt:11 Base address: Oxef80 

Note that the word UP is included in the output. This indicates that the operating system not only acknowledges the card's existance, but that the card is willing to accept input. If the output did not include the word UP, you would need to attempt to bring it into an UP state. This is also accomplished by means of the ifconfig command.

 ifconfig eth0 up 

A bewildering variety of things can prevent an Ethernet card from activating. You may not have the proper driver for the card you are using (common in Linuxcheck the manufacturer's Web site and/or buy a card for which there is a known driver). The driver may be buggy (check the manufacturer's Web site for patches and updated drivers). The IP address or netmask which you are attempting to use may violate some deep dark corner of the relevant RFCs. [4] (In this case, test the card with a known good IP address and netmask.) The card itself may be damaged or defective. (Try swapping out the card.)

[4] RFC stands for "Request For Comment." An RFC is a de facto standard for one of a variety of computer and electrical engineering topics.

If the ifconfig command shows the card in an UP status, try to ping your own IP address. If that works, but you still can't connect to the outside world, your problem most likely has something to do with the physical connection.

Reconfiguring Your Network Card

The ifconfig command can also be used to set the values of your network card. Bear in mind that the ifconfig command varies slightly across the different flavors of Unix, so you should definitely consult your man pages before typing. But just for purposes of illustration I'll use the following command, which would, on HP UX 11.0, set the card to an IP address of 192.251.100.32 with a netmask of 255.255.255.0:

 ifconfig lan1 192.251.100.32 netmask 255.255.255.0 

Clearing the ARP Table

Your computer's IP address is associated with the unique MAC address of your Ethernet card. The intermediate network hardware (routers, switches, etc.) between the client and server may sometimes become confused as to which MAC address owns a particular IP address.

This problem usually shows up when you have assigned an IP address to a new card on the same network. It will usually correct itself eventually, but to speed things up you can manually force the routing hardware to clear the address-resolution-protocol (ARP) table with a hardware-specific command like:

 clear arp 

This must be issued on the hardware that you suspect is the culprit.



BEA WebLogic Server Administration Kit
BEA WebLogic Server Administration Kit (Prentice Hall PTR Advanced Web Development)
ISBN: 0130463868
EAN: 2147483647
Year: 2002
Pages: 134
Authors: Scott Hawkins

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