Tag Archives: networking

Where’s My Traceroute in Ubuntu

By default if you try to use the traceroute command in Ubuntu it will suggest installing the application since there is no application by such name installed.


user@bicerin:~$ traceroute
The program 'traceroute' can be found in the following packages:
* inetutils-traceroute
* traceroute
Try: sudo apt-get install

While you could apt-get install traceroute your way out of it, you could instead use the included mtr application.

http://manpages.ubuntu.com/manpages/gutsy/man8/mtr.8.html

mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

I like the way mtr presents the output instead of the normal traceroute applications, mtr constantly pings the address in a live manner and watch the output update according to network conditions.


user@bicerin:~$ mtr linhost.info

Host Loss% Snt Last Avg Best Wrst StDev
1. OpenWrt.lan 0.0% 3 0.5 0.5 0.4 0.5 0.0
2. ???
3. te-9-2-ur01.fourhills.nm.albuq.comcast.net 0.0% 2 9.3 8.9 8.5 9.3 0.5
4. te-4-2-ar01.albuquerque.nm.albuq.comcast.net 0.0% 2 8.8 9.2 8.8 9.6 0.5
5. te-0-0-0-8-cr01.denverqwest.co.ibone.comcast.net 0.0% 2 18.0 23.1 18.0 28.3 7.2
6. he-3-12-0-0-cr01.denver.co.ibone.comcast.net 0.0% 2 21.2 21.0 20.9 21.2 0.2
7. xe-0-0-0.bbr01.cf01.den01.networklayer.com 0.0% 2 17.3 17.2 17.0 17.3 0.2
8. ae12.bbr02.eq01.dal03.networklayer.com 0.0% 2 31.8 33.0 31.8 34.2 1.7
9. po32.dsr01.dllstx3.networklayer.com 0.0% 2 31.6 31.6 31.6 31.7 0.1
10. po31.dsr01.dllstx2.networklayer.com 0.0% 2 31.9 32.4 31.9 33.0 0.8
11. po1.car14.dllstx6.networklayer.com 0.0% 2 34.8 35.1 34.8 35.3 0.4
12. gator524.hostgator.com 0.0% 2 31.9 32.8 31.9 33.7 1.3

I didn’t know about mtr which is why I decided to create this post as a reminder.

Scan a subnet with Nmap

Simple Nmap combination useful if you need to scan an entire subnet for active hosts and the IP addresses used by the same. I am not an expert on Nmap if you have a better method let me know.

1. From a command line window issue the command below.

nmap -v -sn 192.168.1.0/24
  • -v
  • Vervose

  • -sn
  • Ping scan – disable port scan

2. Nmap outputs its findings along with the IP address and MAC address of the clients on the subnet.

# nmap -v -sn 192.168.1.0/24

Starting Nmap 5.51 ( http://nmap.org ) at 2012-11-05 00:10 Mountain Standard Time
Initiating ARP Ping Scan at 00:10
Scanning 11 hosts [1 port/host]
Completed ARP Ping Scan at 00:10, 0.53s elapsed (11 total hosts)
Initiating Parallel DNS resolution of 11 hosts. at 00:10
Completed Parallel DNS resolution of 11 hosts. at 00:10, 16.50s elapsed
Nmap scan report for 192.168.1.0 [host down]
Nmap scan report for 192.168.1.1
Host is up (0.0010s latency).
MAC Address: 00:90:7F:26:3E:13 (WatchGuard Technologies)
Nmap scan report for 192.168.1.2 [host down]
Nmap scan report for 192.168.1.10 [host down]
Initiating Parallel DNS resolution of 1 host. at 00:10
Completed Parallel DNS resolution of 1 host. at 00:11, 16.50s elapsed
Nmap scan report for 192.168.1.11
Host is up.
Initiating ARP Ping Scan at 00:11
Scanning 244 hosts [1 port/host]
Completed ARP Ping Scan at 00:11, 1.96s elapsed (244 total hosts)
Initiating Parallel DNS resolution of 244 hosts. at 00:11
Completed Parallel DNS resolution of 244 hosts. at 00:11, 16.50s elapsed
Nmap scan report for 192.168.1.12 [host down]
Nmap scan report for 192.168.1.17 [host down]
Nmap scan report for 192.168.1.18
Host is up (0.0019s latency).
MAC Address: 00:0C:29:97:30:0A (VMware)
Nmap scan report for 192.168.1.19 [host down]
Nmap scan report for 192.168.1.255 [host down]
Read data files from: C:Program Files (x86)Nmap
Nmap done: 256 IP addresses (3 hosts up) scanned in 52.16 seconds
           Raw packets sent: 509 (14.252KB) | Rcvd: 3 (84B)

New Virtual Machines: BSD Router Project (BSDRP)

BSD Router Project (BSDRP) is an embedded free and open source router distribution based on FreeBSD with Quagga and Bird. This is a 17MB download, you will need 7-Zip to decompress the contents. Due to the small image size I will update the image accordingly as updates are released.

  • CPU: 1
  • Memory: 128MB
  • Disk Space: 8GB
  • Networking: 3 Interfaces | NAT | Sound card: Enabled
  • Compressed using 7-Zip

BSD Router Project 1.1 32-Bit 17MB
.MD5
.SHA1

BSD Router Project 1.1 64-Bit 17MB
.MD5
.SHA1

Q&A: To Auto Negotiate Or Not

It seems that IT professionals have different views on auto-negotiation, some recommend using it others prefer to not use it at all. What’s the reason behind this variation ?

The whole stigma around auto-negotiation is the result of open interpretation, at the time(90s) vendors agreed that auto-negotiation was a neat idea, but like always each vendor had its own interpretation of auto-negotiation. This lead to auto-negotiation being unable to work between vendor A and vendor B. Rather than have a malfunctioning link the solution at the time was to manually set the speed and duplex, this meant that adapters and switches from different vendors would be able to work with each other.

Despite the improvements and ratifications over the years auto-negotiation still enjoys a not so favorable reputation in the IT community, To summarize, the problem was that auto-negotiation back then was not the same standard we have today.

In the early years…

  1. 1995 IEEE802.3u released.
  2. 1998 Open / different interpretations of IEEE802.3 were ended after being ratified that year.
  3. 1999 IEEE802.3ab brought gigabit Ethernet and mandated auto-negotiation on 1000BASE-T aka gigabit Ethernet over copper.

As you can see with every sequential release auto-negotiation went from being loosely mandated to required on gigabit Ethernet.

All 1000BASE-T PHYs shall provide support for Auto-Negotiation (Clause 28) and shall be capable of operating as MASTER or SLAVE. Auto-Negotiation is performed as part of the initial set-up of the link, and allows the PHYs at each end to advertise their capabilities (speed, PHY type, half or full duplex) and to automatically select the operating mode for communication on the link.

Auto-negotiation signaling is used for the following two primary purposes for 1000BASE-T:

To negotiate that the PHY is capable of supporting 1000BASE-T half duplex or full duplex transmission.

To determine the MASTER-SLAVE relationship between the PHYs at each end of the link. 1000BASE-T MASTER PHY is c from a local source. The SLAVE PHY uses loop timing where the clock is recovered from the received data stream.

Clause 40.5.1 IEEE 802.3 standard.

The rule of thumb should be to let auto-negotiation happen unless for some reason you still have legacy equipment in the network.

Links

http://standards.ieee.org/reading/ieee/interp/IEEE802.3af-2003interp-6.pdf
http://www.sun.com/blueprints/0704/817-7526.pdf

Enable ping on Windows Server 2008

By default Microsoft disables Ping on the Windows platform, probably as an added security measure. However Ping maybe needed for testing or monitoring purposes. The process to allow Windows Server to respond to Pings is minimal, requiring few changes to the Windows firewall.

Go to Start > Administrative Tools > Windows Firewall with Added Security

start-control-panel

On the sidebar look for Inbound Rules > File and Print Sharing (Echo Request – ICMPv4-IN) > right click on Enable Rule

enable-rule

The rule has now been enabled and the server will respond to Pings.

rules-enabled

If you wish to later disable ping all you have to do is right click on the rule and select > Disable Rule

Configure Ubuntu Server with static IP

It’s not recommended to assign IP address to servers using DHCP since the IP address can change after the lease expires. Just imagine having all the users or devices that need access to the server stopping because the server changed IP address.

In Ubuntu/Linux the process of assigning a static IP to the server is an easy task that only requires the modification of one file and issuing a few commands.

Using you favorite text editor open the file /etc/network/interfaces.

sudo nano /etc/network/interfaces

This is how the the /etc/network/interfaces file looks like.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

You can safely erase all the information for eth0 and add the information below. Make sure to change the information in order to meet your networking requirements.

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

After adding the appropriate networking information you can restart the networking service for the new changes to take effect.

sudo /etc/init.d/networking restart

How To Set A Static IP On Ubuntu 8.10

Known network manager bug https://bugs.edge.launchpad.net/ubuntu/+source/network-manager/+bug/284298

Due to a bug if you want to assign a static IP on Ubuntu 8.10 Desktop your setting will be overwritten after the next reboot because of a bug that escaped the Ubuntu team. The bug is annoying and silly that something so basic would escape the development team.

Any way there are two solutions one uses the command line and the second one the GUI.

First Solution

First solution is to get down and dirty with the command line, it takes less than 2 minutes. Edit /etc/network/interfaces and enter the following values.

sudo nano /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.3
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

And save it.

Now move on to edit the /etc/resolv.conf. And add the name server.

sudo nano /etc/resolv.conf
nameserver 192.168.1.1

If you don’t want to reboot the system restart the networking service instead.

sudo /etc/init.d/networking restart

Second Solution

  1. Right click on the network icon located in the top panel. Select Edit Connections…
  2. Right click on Add. This is when we add the new configuration.
  3. Now you are presented with empty fields. Check Connect automatically at the top, otherwise the older configuration will take over. For the configuration to work you need to provide the MAC address of your network interface card in my case it’s eth0.Tip : Issue ifconfig in the command line and copy and paste the resulting MAC address.
  4. In the same windows select the IPv4 Setting tab, the drop down menu will offer various option select Manual.
  5. After selecting Manual you have to provide the IP Address, Netmask, Gateway and DNS Server. Now click OK to save the settings.
  6. Now the new connection named “Wired connection 1” is available.
  7. Go back to the network icon located in the top panel and right click on it. Wired Connection 1 is now an option right click on it. The system will now change from the previous interface configuration the the new one.Tip :  To verify the changes issue the ifconfig command.
  8. The last and perhaps most important step is to go back in to Edit Connections… and unchecked the Connect automatically option on Auto eth0 which is the previous faulty Ubuntu configuration. Failure to do so will result in the Auto eth0 taking over the new configuration on the next reboot.

Drop me a line if this was of any help to you.