Troubleshooting the network

From FBSD_tips

Jump to: navigation, search

DRAFT - INCOMPLETE - DRAFT - INCOMPLETE

Contents

[edit] Rationale

This document is designed in a flow chart like structure to step through a debugging process for network connectivity, from the lowest level to increasingly higher levels. It only takes into account the simplest cases(s) and is by no means exhaustive.

[edit] Physical connectivity

First, you have to find your primary interface, ifconfig can assist you here.

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        ether 00:0e:0c:59:03:36
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
fwe0: flags=108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
        options=8<VLAN_MTU>
        ether 02:00:00:05:34:f4
        ch 1 dma -1
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000

First, you look for an interface that has a media type of Ethernet. lo0 is the defauly loopback interface and should be present always so we ignore it now. plip0 is an IP over parallel port interface and we will ignore it too. If you have a firewire interface you may also see fwe0, an IP over firewire interface which we will also ignore for now. The em0: interface is of the correct media type. On the ethernet interface you need to see a status of active.

[edit] Possible issues

  1. Not cabled, not cabled correctly.
    1. Try a different cable
    2. Make sure everything is seated correctly
  2. Problem with the switch, hub or other network equiptment.
    1. Change ports
  3. The NIC could be defective or not completely supported by the driver.
    1. Try a different NIC
  4. Auto negotiation could be failing.
    1. Try setting it manually e.g. media: Ethernet autoselect (1000baseTX <full-duplex>)

[edit] IP connectivity

There are 2 ways you can get your IP information, statically assigned at the system startup or obtained via DHCP from a serbver on your LAN. Choose one (but not both) of the following methods :

[edit] 1) Static assignment

In /etc/rc.conf put this line or make sure that it is correct.

ifconfig_em0="inet 10.1.1.1 netmask 255.255.255.0"

Of course, substitute your own :

  1. Interface instead of em0
  2. IP address instead of 10.1.1.1
  3. netmask instead of 255.255.255.0

[edit] 2) DHCP

In /etc/rc.conf put this line or make sure it is correct.

ifconfig_em0="DHCP"

The best way to see these changes take effect is to reboot. Once you are back up, can you ping your own IP address? If not, a very common cause is a misconfigured firewall, disable any firewalls and try again.

To disable IPFW (NOTE: do not do this while logged in over the network, see Firewalling while logged in over the network) :

ipfw -f flush
ipfw add pass all from any to any

[edit] Routing

Do you have a default gateway set up? Here is one way to find out :

 > netstat -rnf inet
Routing tables

Internet: 
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.100.1.1         UGS         0  3860965    em0
10.100.1/24        link#1             UC          0        0    em0
10.100.1.1         00:04:ac:2e:2c:5a  UHLW        2  2470549    em0   1161
10.100.1.139       00:17:f2:ee:50:dc  UHLW        1       18    em0   1196
127.0.0.1          127.0.0.1          UH          0    28853    lo0

Here 10.200.1.1 is the default router. Try pinging the default router, you should see replies.

 > ping -c 4 10.100.1.1
PING 10.200.1.1 (10.200.1.1): 56 data bytes
64 bytes from 10.100.1.1: icmp_seq=0 ttl=64 time=0.192 ms
64 bytes from 10.100.1.1: icmp_seq=1 ttl=64 time=0.185 ms
64 bytes from 10.100.1.1: icmp_seq=2 ttl=64 time=0.185 ms
64 bytes from 10.100.1.1: icmp_seq=3 ttl=64 time=0.192 ms

--- 10.100.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.185/0.189/0.192/0.003 ms

If you don't have a default router on a network, ping a maching that you know to be up on the same network as the interface in question.

[edit] Possible issues

If you get timeout, your trouble couls be :

  1. Hardware - cabling, bad port on switch/hub
    1. Try a different cable
    2. Try a different port
  2. Signalling - e.g. incorrent duplex, incorrect speed
    1. Manually set the speed
    2. Manually set the duplex
  3. Netmask - wrong netmask on host or router
    1. Check that they match

[edit] Adding a default router

If you do not have your default router set this is how to set one, replacing your IP for 10.100.1.1. If you get your IP via DHCP this should not apply to you.

In /etc/rc.conf :

defaultrouter="10.100.1.1"

Reboot to have this setting take effect.

[edit] Name resolution

Set the hostname.

Do you have a source for name resolution?

Are there local hosts that must go into /etc/hosts?

[edit] Internet services

Can you open connections to typical internet services?

Personal tools