LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-01-2011, 08:41 PM   #1
studpenguin
Member
 
Registered: Nov 2003
Location: Pacific Northwest United States
Posts: 286

Rep: Reputation: 33
IPCONFIG translated to Linux: important network information about your computer


I kind of really like this clever solution if you are use to typing ipconfig in the Windows DOS Command prompt:




http://ubuntuforums.org/showthread.php?t=76078

Quote:
Re: Equivalent of "IPCONFIG /ALL"
I know it's been a looonnggg time since anyone posted to this thread, but I had the same question and created my own little script to give this info in a single command. I know it's probably not the most elegant script. And I'm sure there's a thousand other ways to do it better, but it works for me! Hope this helps someone out there.

Just open your choice of text editor, copy/paste the text below and don't forget to give it an ".sh" extension when naming the file. For example, just for kicks and giggles I named mine "ipconfig.sh".

-----------------------------------------------------------------------------------
following those exact instructions doesn't quite work for me for whatever reason. I don't know why,


BUT


subtract this line from that script file that you shoved in the arse of the local bin folder he described:



Quote:
Code:
#! /bin/bash
and the rest works for me
Quote:
Code:
ifconfig
echo
echo Gateway"               "Interface
route -n | awk '/UG/ {printf "%-21s %s\n",$2,$8}'
echo
echo DNS Servers
awk '/nameserver/ {print $2}' /etc/resolv.conf
echo
After you've created the script, navigate to the folder the script is located in and run:

Code:

Code:
 sudo chmod +x scriptname.sh
That makes the script executable from the CLI. After that I copied the script into the /usr/local/bin folder. That way you're able to simply run the script from the CLI without having to reference the folder the script was originally located in.

What's really neat is that when I connect to work via an IPSEC VPN, the script catches all of the new settings and gives both gateways in use. Wasn't expecting that without some extra work, but what do I know?
__________________
gotee12
Professional Ubuntu Noob
Last edited by gotee12; April 26th, 2008 at 11:15 PM.. Reason: code error, extra apostrophe removed
gotee12 is offline Reply With

Last edited by studpenguin; 01-01-2011 at 09:25 PM.
 
Old 01-02-2011, 12:52 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Have to say that this seems like a waste of time to me. It's not polling much useful information, dumping more useful info than it keeps. Why bother?
 
  


Reply



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
Need to create script that gives me network computer information. rahilmaknojia Programming 4 10-28-2009 01:23 PM
Some Important Information ... rickh General 1 12-02-2007 04:43 PM
Important Information when posting in the LFS Forum. trickykid Linux From Scratch 0 09-21-2003 10:52 AM
Some important information for Slackware install newbies nirvanix Slackware 13 06-24-2003 11:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:11 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
Open Source Consulting | Domain Registration