Request Linux network debugging command advice

Somehow, on Centos6, I was able to get connected to a test wireless ISP antenna, but I'd like advice on being 'smoother' next time.

DO you have advice for better DEBUGGING networking on Linux?

Here's my saga:

- I mounted a ubiquiti rocket M2 radio outside & set it up

- I turned off my wireless adapter with a switch on the laptop

- I plugged in a cat5 cable linking the radio with the laptop ... First problem: I couldn't connect to the radio at 192.168.1.20 # ping 192.168.1.20 failed http://192.168.1.20 failed

- I solved the connect problem by setting my laptop to the same subnet

- $ sudo ifconfig eth0 192.168.1.21 ... Second problem: The gateway was 0.0.0.0 instead of 192.168.1.20 # arp -n showed the gateway for eth0 to be 0.0.0.0 # route -n showed the eth0 gateway to be 0.0.0.0

- I solved the gateway by running the route command

- $ sudo route del default gw 0.0.0.0 eth0

- $ sudo route add default gw 192.168.1.20 eth0 ... Third problem: The DNS servers in the radio were not found

- I solved that by editing the /etc/resolv.conf file

- $ vi /etc/resolv.conf (I added these two lines) nameserver 8.8.8.8 nameserver 4.2.2.2

At this point, the following commands started working: $ host

formatting link
$ nslookup
formatting link
$ dig
formatting link
$ traceroute
formatting link

But strangely, the web still failed for a while - but then - inexplicably

- the web finally started working.

I wish I had better debugging skills as I had to look up all the steps above: a) How to set the eth0 adapter to the same subnet as the radio b) How to set the gateway on the laptop (no router is involved) c) How to set the DNS servers on the laptop (connected directly to the radio)

Do you have debugging suggestions?

Reply to
Unknown
Loading thread data ...

OK, you're not configuring things. EITHER you want to set things to static values, _OR_ you want the radio to act as a DHCP server over the Ethernet as well as the wireless link. My guess is that the radio isn't configured to offer DHCP over the Ethernet interface. CentOS? It's got some "let-me-do-this-for-you-you're-to-stupid-to-try-this" helper tool, perhaps Network Manager. The alternative would be to configure things manually, likely involving scripts in /etc/sysconfig/network-scripts/ (probably ifcfg-eth0).

You did fine. Always use '/sbin/ifconfig' and '/sbin/route' to see if the interface has an address, and the appropriate routes exist. You should also know the IP address of some other systems on the local LAN and one or more "outside". 'ping' isn't as reliable as a tool, because many people block pings. On the local LAN, try a ping, and even if you don't get a response, look at '/sbin/arp -a' and see if the remote host did respond with a hardware address. No hardware address means no route/address. If you can ping or otherwise connect to a remote host by IP but not name, that's pointing at /etc/resolv.conf.

That's probably all in /etc/sysconfig/network-scripts/ifcfg-eth0 and is explained in the appropriate documentation page. I'm not running CentOS, but try 'rpm -qdf /etc/sysconfig/network-scripts/ifcfg-lo' which asks the package manager (rpm) to list the documentation files related to the ifcfg-lo file. You'll find something like '/usr/share/doc/initscripts-*/sysconfig.txt which describes what each variable means.

Old guy

Reply to
Moe Trin

Whoops! Missed that - In *nix networking, the gateway is the IP address of the "next hop" router/forwarder. Lessee...

[example ~]$ /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 89948 eth0 192.168.2.0 192.168.1.6 255.255.255.0 UG 0 0 32165 eth0 0.0.0.0 192.168.1.248 0.0.0.0 UG 0 0 2673 eth0 [example ~]$ /sbin/ifconfig -a

First line - 192.168.1.x (destination plus mask) are on eth0 and can be reached directly. No gateway needed.

Second line - there is another network using addresses 192.168.2.x. To reach those hosts, the kernel to told to deliver the packets to (a router at) 192.168.1.6, and that box will forward them. (Hosts on the other net have to know to reply to the 192.168.2.x address of the router what ever that might be, to reach "this" net.)

Third line - if the first two don't match the destination address (that is, a destination address of 1.0.0.1 through 126.255.254 and

128.0.0.1 thorough 192.168.0.254 and 192.168.3.1 through 255.255.255.254) send it to the "default" router on 192.168.1.248. Addresses of 0.x.x.x, 127.x.x.x and 255.255.255.255 are special cases with other meanings.

Linux networking tools are a bit simple-minded, and when they see the word "gateway", they assume you mean a default gateway to the world. For many installations, that's a reasonable assumption, but it's not always true as shown above.

Old guy

Reply to
Moe Trin

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.