LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

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.

Quote:
$ /sbin/ifconfig
eth0 Link
...
LQ Newbie
Posted in Uncategorized
Views 14263 Comments 0 bittner is offline

  



All times are GMT -5. The time now is 01:39 PM.

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