LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-14-2010, 07:51 AM   #1
systemlordanubis
Member
 
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 123

Rep: Reputation: 16
Iterating through eth and vlan interfaces in perl


Hello,

I'm searching for a small perl script to iterate through the configured eth and vlan interfaces to get their assigned ip address and perform some processing.

I'm after something like:


@interfaces = (waytogetinterfaces);

foreach (@interfaces){

#perform processing
print "Interface IP is: ", $_->IP;

}

Thanks
Anubis.
 
Old 07-14-2010, 11:48 PM   #2
lbrigman124
LQ Newbie
 
Registered: Jun 2006
Location: Oregon
Distribution: FC4-6,FC1,RH8-9, LFS,RHEL5, CENTOS5, Unbreakable5
Posts: 10

Rep: Reputation: 1
Try the info from here.
http://search.cpan.org/~lds/IO-Inter...8/Interface.pm
 
Old 08-01-2010, 10:06 PM   #3
systemlordanubis
Member
 
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 123

Original Poster
Rep: Reputation: 16
Hi lbrigman124,

Thanks for the link, however I've opted to write my own custom script using ipconfig and grep to extract all the info I needed.

Thanks
Anubis.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi perl and iterating h/w Programming 13 11-29-2007 12:15 PM
Multiple interfaces in one VLAN Fund-A-Mental Linux - Networking 1 03-06-2007 07:44 AM
eth interfaces drop after a while agreenwood Slackware 2 01-31-2006 01:27 PM
configuring eth interfaces problem cranium2004 Linux - Networking 5 04-07-2005 06:55 AM
Two eth interfaces, but one only with internet... Creak Linux - Networking 6 03-12-2005 01:52 AM


All times are GMT -5. The time now is 09:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration