Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-14-2010, 08:51 AM   #1
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 141

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


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;


Old 07-15-2010, 12:48 AM   #2
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.
Old 08-01-2010, 11:06 PM   #3
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 141

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.



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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:07 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