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:
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
|