ifconfig

how to write a program to report the local IP address such as 192.168.1.102?

since my Linksys router doesn't assign a fixed local IP to the computers (PC and Mac and Linux), i'd like to write a script so that every minute, the computers will update to each other so that http://localhost/list.html on each machine will contain a list of names of all PC and Mac and a link to their apache server (pointing to http:/...

How to monitor Network tarffic with MySQL?

ifconfig -output is somewhat messy thing to look at. When I saw the nice output below with the command (source), the question emerged: Is there some more structured way, let say MySQL, to look at ifconfig or similar data? It would be cool, if I could monitor the network traffic in databases. [prompt]$ mysqladmin -h localhost -u...

Parse numeric ifconfig flags

The ifconfig command outputs its flags in both textual and numeric format. While I can find a reference here or there to the numeric flags, I cannot find any indication on how to interpret (mask) the number. qfe2: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 4 usesrc vni0 inet 1.2.3.4 netmask ffffff00 b...

How to detect vpnc disconnection ?

Hi, What is the easiest way to detect that a vpnc connection on Linux/Ubuntu has disconnected ? Manually, I think the way to detect is to check whether the interface (tun0) appears in /sbin/ifconfig output. Is there a better way to find out immediately, so that a script can be run to restart the connection ? ...

Get network interface information

I know there is ifconfig command that we can list network interface info. but i want to get information in the following pattern Interface_Name IP_Address Net_Mask Status(up/down) for example eth0 192.168.1.1 255.255.255.0 down I tried ifconfig and grep command but can't get right pattern. There is another command or some trick to do...

ifconfig packet count

Hi, if I type ifconfig i get packet for Tx and RX ... where exactly the piece of code to increment this counter? Is it in the network driver itself? or in the kernel ? If possible please provide lxr link of the counter variable used. Thx ! ...

Solaris: Programmatic interface to ifconfig?

I'm looking for a programmatic interface to the Solaris ifconfig(1M) command. Apparently Linux has the getifaddrs(3) command, but as far as I can tell this has not been ported to Solaris. Short of attempting to use the code at the link above, is there any way to determine ifconfig(1M)-type data (network interface presence, state, etc.)...

Bash script issue

I can run this command fine, with the output I want: ifconfig eth0 | grep HWaddr | awk '{print $5}' However, when I set the command to a variable, and print the variable, I get an error: CASS_INTERNAL=`ifconfig eth0 | grep HWaddr | awk '{print \$5}'` $CASS_INTERNAL my internal xxx ip: command not found The weird thing - my intern...

Get list of 'Friendly interface names' on a Mac (Airport, Ethernet, etc)

Hi, I'm developing an application in RealBASIC, but I need the list of interface names to populate a dropdown box. Parsing ifconfig didn't work (Got eth0, eth1, lo, etc...) I need the name that is displayed in system preferences (Ethernet, Airport, etc...) Is this possible in RealBASIC or is there a terminal command I can parse? Than...

How do I get the IP of only one Interface

When I tried ifconfig it gives me the whole all the information regarding the Network Adapter. I tried : system( "ifconfig -a | grep inet | " "sed 's/\\([ ]*[^ ]*\\)\\([ ]*[^ ]*\\).*$/\\1 \\2/' " " > address.txt" ) ; which output two Ips : inet addr:17.24.17.229 inet addr:127.0.0.1 But I need just the 1st...

connecting to wifi network using username and pass (GNU/Linux)

Hi, I have a problem to connect to wifi network, because I dont know how to set username and password, needed by network. I usually use "iwconfig" command to connect. But I didnt find nothing in man pages how to say which pass and username will be used in authentification process. Thanks for every advice. Bey ...