LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 08:51 AM   #1
systemlordanubis
Member
 
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 126

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-15-2010, 12:48 AM   #2
lbrigman124
LQ Newbie
 
Registered: Jun 2006
Location: Oregon
Distribution: FC4-6,FC1,RH8-9, LFS,RHEL5, CENTOS5, Unbreakable5
Posts: 12

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

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 01:15 PM
Multiple interfaces in one VLAN Fund-A-Mental Linux - Networking 1 03-06-2007 08:44 AM
eth interfaces drop after a while agreenwood Slackware 2 01-31-2006 02:27 PM
configuring eth interfaces problem cranium2004 Linux - Networking 5 04-07-2005 07:55 AM
Two eth interfaces, but one only with internet... Creak Linux - Networking 6 03-12-2005 02:52 AM


All times are GMT -5. The time now is 03:47 PM.

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