Sunday, January 03, 2010


I have 38 Google Wave invites. Send me an e-mail for an invite.

Friday, November 20, 2009

Linux Networking: ip obsoletes ifconfig

If you are already familiar with the ifconfig command to manage network interfaces under Linux, it may come as a surprise that it has been replaced with the ip command since Linux 2.2. Even if you do know of the ip command, you may still be using the ifconfig command out of habit. I've thrown together a quick list of ifconfig equivalent ip commands to help you make the transition.

The ip command is able to do a lot more than what is listed below, but I will only focus on the ifconfig equivalent features. The ip command splits the functionality of link information and address information into two sets of commands, so some commands will require running ip twice, once for link status and once for address information. The ifconfig command shows only those interfaces currently UP by default, the ip command shows all interfaces by default unless you specify UP.

Showing default ifconfig information:
  • ifconfig # shows all UP interfaces, addresses, and link status
  • ip -s link up # shows link status for all UP interfaces
  • ip addr up # shows address information for all UP interfaces
Showing all interface information:
  • ifconfig -a
  • ip -s link
  • ip addr
Device specific information:
  • iconfig eth0
  • ip -s link eth0
  • ip addr show eth0
Bringing an interface down:
  • ifconfig eth0 down
  • ip link set eth0 down
Setting address information:
  • ifconfig eth0 192.168.0.20 netmask 255.255.255.0 broadcast 192.168.0.255
  • ip addr add dev eth0 192.168.11.2/24 broadcast 192.168.0.255
If you want to bring up the interface at the same time you will append "up" to the ifconfig command line. To bring up the interface with ip you will have to run ip a second time with ip link set eth0 up as it cannot be combined with the ip addr command.

Network aliases:

The ip command does not have to use aliases, but can manage aliases created by ifconfig by labelling an address. Assuming no 10 addresses have been added to eth0, the following three commands would add two primary addresses and one secondary address.
  • ip addr add dev eth0 10.0.0.1/24 broadcast 10.0.0.255
  • ip addr add dev eth0 10.10.10.20/24 broadcast 10.10.10.10.255
  • ip addr add dev eth0 10.10.10.21/24 broadcast 10.10.10.10.255
The first address 10.0.0.1 is on it's own class C network, whereas 10.10.10.20 and .21 are on the same class C network. You will see a "secondary" flag on the 10.10.10.21 address when running ip addr. After setting up these addresses with ip, ifconfig will NOT see anything except for the 10.0.0.1 address because ifconfig only understands how to list one ip address per interface / alias (label).

To manage aliases with ip addr, use the "label" keyword as below.
  • ifconfig eth0:0 10.10.10.20 netmask 255.255.255.0 broadcast 10.10.10.255
  • ip addr add dev eth0 10.10.10.20/24 broadcast 10.10.10.10.255 label eth0:0
By using the ip command you will be able to see and set additional network parameters that are not available in ifconfig.

Monday, November 02, 2009

I love teaching in Austin

Thursday, May 13, 2004

Working out, Biking to Zilker

I've been doing cardiovascular workouts for a little over a month and have really noticed an improvement in my stamina when working out. Last week I biked to work (about 8 miles) for the first time after moving to my Duplex.

Yesterday the LabVIEW development team had a 7.1 release party at Zilker park. Steve Rogers, Christi Dellis and I biked about from Northcross Mall to Zilker (around 15 miles?). Once there we met up with the rest of the team, ate lunch, recieved awards (I got a "hero" plaque + $50 night out on the town), played some disc golf, listened to "manager karaoke", and then biked back! I was quite proud of myself for making it both ways. View Map.

When I got back home I went ahead and mowed the lawn as well!

davidduffey.blogger.com

Hmmm... anyone remember "Brainwaves," my first blog using perl and mysql? Before they were "blogs?"