momerath
07-24-2003, 11:03 PM
First, a brief explanation of what I'm trying to do. I'm playing with the tcpflow utility and I want to run a single command (which I will later store as an alias) to write all of the tcp traffic to and from my machine.
The utility tcpflow will look at all of the traffic it can see (regardless of whether it's to one's own computer or not). There is a way to exclude one IP address or only show traffic to one IP address. I have everything worked out except for how to get my own IP address from the command line:
mkdir -p ~/Desktop/output; cd ~/Desktop/output; sudo tcpflow -i en0 host `get_the_ip_command`
Basically, all I need is a UNIX command to output my computer's IP address that is visible to the internet.
And no, using "localhost" does not work.
The utility tcpflow will look at all of the traffic it can see (regardless of whether it's to one's own computer or not). There is a way to exclude one IP address or only show traffic to one IP address. I have everything worked out except for how to get my own IP address from the command line:
mkdir -p ~/Desktop/output; cd ~/Desktop/output; sudo tcpflow -i en0 host `get_the_ip_command`
Basically, all I need is a UNIX command to output my computer's IP address that is visible to the internet.
And no, using "localhost" does not work.