Welcome to the most active Linux Forum on the web.
Go Back > Blogs
User Name


I leave notes here that I find particularly worth remembering myself.

CIDR to Netmask conversion with Python (convert short netmask to long, dotted format)

Posted 09-03-2010 at 05:43 AM by bittner (Notes on Linux)
Updated 09-03-2010 at 10:20 AM by bittner

When you write scripts dealing with setting up or analyzing network interfaces you will eventually run into the task of converting a netmask from one format into another.

Typically, the setup of an ethernet TCP/IP network interface consists of an IP address, a netmask, and a broadcast address. Unfortunately for you as a novice, the two tools ifconfig and ip show the same (or similar) information in a different format.

$ /sbin/ifconfig
eth0 Link
LQ Newbie
Posted in Uncategorized
Views 7174 Comments 0 bittner is offline


All times are GMT -5. The time now is 06:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration