Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

2012-01-07

WNDR3800 wireless performance

After looking at wired performance, I've got a spin at wireless:
Test conditions were as follows:

Router Firmware Version: V1.0.0.24
PC 1: notebook with Intel PRO/Wireless 4965 AG
PC 2: desktop with nVidia Corporation CK804 Ethernet (Gigabit speed)
PC 1 was within one meter from the router

On PC 1:
# dd if=/dev/zero bs=4096 count=102400 | nc 192.168.1.31 1999

On PC 2:
# nc -l 1999 | dd of=/dev/null

Speed reported is from dd output on PC 1:


Speed MB/s
2.4Ghz@54Mbs  2.6
2.4Ghz@130Mbs8.1
2.4Ghz@300Mbs9.3
5Ghz@300Mbs9.0



2012-01-04

Netgear WNDR3800 switch performance

I'm trying the WNDR3800.
Some reviews are reporting less than stellar performance on the gigabit switch.
I've done some testing myself.
Using 2 linux pcs, with gigabit ethernet ports, I've put the first in receiving mode:

# nc -l 1999 >/dev/null

and then I started sending data from the second one:

# cat /dev/zero | nc 192.168.1.2 1999

The result is well over 110 MB/s:



Then, I've repeated the test using a straight cable connection between the two machines:


The result is pretty much the same, so the switch part of the WNDR3800 does not significantly impact performances.

2012-01-01

WiFi toggle on Asus WL-550gE


I don't feel confortable sleeping with my wifi on, so here is a script to turn it off at night:

First I created 2 scripts, one to turn it off:

# vi /root/wifi-off

#!/bin/sh
 
uci set wireless.@wifi-device[0].disabled=1
wifi
echo wifi disabled

And one to turn it back on:

# vi /root/wifi-on

#!/bin/sh
 
uci set wireless.@wifi-device[0].disabled=0
wifi
echo wifi enabled


Then I started up wifi at boot

# vi /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

/root/wifi-on

exit 0


Crontab:

# crontab -e

 0  7 * * * /root/wifi-on
59 23 * * * /root/wifi-off


The cron service is not enabled by default in OpenWRT:

# /etc/init.d/cron enable
# /etc/init.d/cron start

Good night...

2011-12-31

IPv6

The end of the year is time for some balance.
Even though I'm no network admin, knowledge of IP networking is the single most used technical skill in my day-to-day activities.
So, good will for the next year:



2011-12-30

OpenWRT on Asus WL-550gE


Recently my home wireless connection has been shaky: from 20% packet drops to lost connection from time to time.
So, after 6 years of flawless work, I've tried to install OpenWRT on my WL-550gE.
Even though the device is listed as supported, I haven't found any detailed procedure about installing the firmware.
Here is mine:
  • Download and install on a windows machine, the Asus Firmware Recovery Tool.
  • Get the latest OpenWRT image for the asus: note that even if it's a .trx file, upgrading with the router web interface isn't working.
  • Set the windows machine IP as 192.168.1.1/24 and connect it to the LAN1 port of the router.
  • Select openwrt-brcm-2.4-squashfs.trx in the Asus Firmware Recovery Tool but don't press Upload.
  • Launch a ping -t 192.168.1.1
  • Power off the router.
  • Keep the black RESTORE button on the back of the router, pressed and power on. Keep it pressed until the POWER LED begins flashing.
  • When the already running ping shows that the router is responding, press the Upload button in the Asus Firmware Recovery Tool.
  • The firmware will be uploaded and the router will reboot: note that after reboot the POWER LED will remain off.
  • Follow the firstlogin FAQ page to configure the router.

2011-12-02

Windows networking reconfiguration script

If you happen to travel a lot, you'll find yourself changing the ip configuration of your windows laptop more than you'd like to.
Here are a couple of scripts that may come handy.

This script sets your ethernet to DHCP:

@echo off

set INTERFACENAME="Local Area Connection"
ipconfig | findstr Connessione >nul:
if %ERRORLEVEL%==0 set INTERFACENAME="Connessione alla rete locale (LAN)"

netsh interface ip set address %INTERFACENAME% dhcp
netsh interface ip set dns %INTERFACENAME% dhcp

ipconfig /renew %INTERFACENAME%

Note that the script tries to detect the windows language and sets the ethernet interface name accordingly.

This one sets a static IP 1.2.3.4:

@echo off
set IP=1.2.3.4
set MASK=255.255.0.0
set GW=1.2.3.1
set DNS=1.2.3.10

set INTERFACENAME="Local Area Connection"
ipconfig | findstr Connessione >nul:
if %ERRORLEVEL%==0 set INTERFACENAME="Connessione alla rete locale (LAN)"

ipconfig /release %INTERFACENAME%

netsh interface ip set address %INTERFACENAME% static %IP% %MASK% %GW% 1
netsh interface ip set dns %INTERFACENAME% static %DNS%



2011-11-30

An AWK parser for NMAP

NMAP is quite useful for identifing devices on a network, but its output is quite verbose.
Here's an AWK script that parses the output of NMAP into a csv.
It contains some euristics to extract info that might be useful to identify unknown hosts.

function print_buffer()
{
    gsub(":", "", ip)
    gsub("Service Info: ", "", info)
    gsub("\\|_ Discover OS Version over NetBIOS and SMB: ", "", info)
    gsub("Discover OS Version over NetBIOS and SMB: ", "", info)
    gsub(", ", ";", info)
    print ip","os" "hostname" "info
    ip="unknown"
    info="unknown"
    os=""
    hostname=""
}
BEGIN { ip="IP"; info="Info"; }

/Interesting ports/ { print_buffer(); ip=$4 }
/All [0-9]+ scanned/ { print_buffer(); ip=$6 }

/135\/tcp  open  msrpc[ ]+Microsoft RPC/ { if ( os == "") os="Windows NT" }
/135\/tcp  open  msrpc[ ]+Microsoft Windows RPC/ { if ( os == "") os="Windows NT" }
/IIS webserver 3.0/ { os="Windows NT" }
/IIS webserver 4.0/ { os="Windows NT" }
/IIS webserver 5.0/ { os="Windows 2000" }
/IIS webserver 5.1/ { os="Windows XP" }
/IIS webserver 6.0/ { os="Windows 2003" }
/Windows 98 netbios-ssn/ { os="Windows 98" }
/SMB: Windows Vista/ { os="Windows Vista" }
/IIS httpd 3/ { os="Windows NT" }
/Windows XP microsoft-ds/ { os="Windows XP" }
/SMB: Windows XP/ { os="Windows XP" }
/Windows 2000 microsoft-ds/ { os="Windows 2000" }
/Windows 2003 microsoft-ds/ { os="Windows 2003" }
/VMware Authentication Daemon/ { os="VMWare ESX" }
/Apache httpd/ { if ( os == "") os=$7 }
/HP webadmin/ { os="HP" }

/ePolicy Orchestrator \(Computername:/ { hostname=$9 }
/Ultr@VNC \(Name/ { hostname=$6 }
/WinVNC \(Server/ { hostname=$6 }
/Lotus Domino server \(CN=/ { hostname=$7 }

/Service Info/ { info=$0 }
/Discover OS/ { info=info" "$0 }
/telnet/ { info=info" "$4 }
/ ssh / { info=info" unix" }

END { print_buffer() }


Here's a sample output:

xx.xx.xx.10,Windows 2000  OS: Windows |  Windows 2000
xx.xx.xx.12,Windows NT gandalf; OS: Windows |  Windows NT 4.0
xx.xx.xx.13,Windows NT  OS: Windows |  Windows NT 4.0
xx.xx.xx.26,Windows NT bilbo; Host: bilbo.contoso.local; OS: Windows |  Windows NT 4.0
xx.xx.xx.30,  Device: printer
xx.xx.xx.31,  Devices: print server;printer
xx.xx.xx.66,Windows 2000  OS: Windows |  Windows 2000
xx.xx.xx.70,Windows NT aragorn; OS: Windows |  Windows NT 4.0
xx.xx.xx.80,Windows 2000  Host: saruman; OS: Windows |  Windows 2000
xx.xx.xx.82,Windows 2003 pippin; OS: Windows |  Windows Server 2003 3790 Service Pack 2
xx.xx.xx.153,  Device: switch

2011-08-22

Small & Quick VM to test network connectivity

It's quite some time I've been searching for a VM that allows to troubleshoot networking problems on ESX machines.
I've used DSL and his child Tinycore. They are good, they even offer a GUI that may be wasteful for simple network troubleshooting, but both lack tcpdump (at least in the downloadable ISO).
Now I've found something just right for the job.
PLD RescueCD: it's reasonably small (89MB ISO), runs entirely from RAM (as low as 40MB), it has tcpdump on board, nc, nmap and a load of other tools.
As a plus, it has no GUI :-)

I've used it to make sure the correct VLAN was mapped on a ESX machine:
Create a custom VM with 1 cpu, 64MB ram, no disk, 1 ethernet adapter bound to the port group you're investigating, and map the virtual CD to the PLD ISO file.
Boot up the VM and you'll be dropped to the root prompt.

#tcpdump

Even if ESX does not allow promiscuous mode on VM adapters, you'll still be able to see ARP requests from other machines that are on the same VLAN as your own VM.
That should be enough to understand if you've pinched the right VLAN.
Someone may say that ESX itself shows a network hint next to each adapter, but I've seen that such hint is not always reliable or at least is not real time, so a newly attached VLAN may not be immediately visible.

2011-08-20

The case of the missing gateway

I've never quite understood the purpose of the NETWORK entry in the ifcfg file of the redhat-based linux distributions.
It can be derived from ip and mask, and if you leave it out altogether, the network works fine as well.
But if you decide to use it, be sure to write it correctly.
The other day I found an ESX machine (that's using redhat as the service console) that loses its default gateway after each reboot.
The gateway was correctly specified in the /etc/sysconfig/network file. After some fiddling I've noticed that the NETWORK clause in /etc/sysconfig/network-scripts/ifcfg-vswif0 was totally wrong. It's not even possible to set it with the vsphere client so I think someone mistyped it while manually configuring the ESX.
Once corrected, a

#service network restart

brought back the ESX online with the vcenter server.