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:
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.
To manage aliases with ip addr, use the "label" keyword as below.
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
- ifconfig -a
- ip -s link
- ip addr
- iconfig eth0
- ip -s link eth0
- ip addr show eth0
- ifconfig eth0 down
- ip link set eth0 down
- 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
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
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
Monday, November 02, 2009
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!
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?"
Subscribe to:
Posts (Atom)