LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Prob involving tcpdump + ping on liveCD (https://www.linuxquestions.org/questions/linux-newbie-8/prob-involving-tcpdump-ping-on-livecd-534763/)

uncle-c 03-05-2007 10:44 AM

Prob involving tcpdump + ping on liveCD
 
Hi,
Just mucking about on the Slax 5.1.8 live CD but perhaps this prob may apply to any live CD.

I want to look at some tcpdump output when I ping the local host. The machine is not connected to the Internet it is just a regular standalone with NIC at eth0.

I open up two terminals. In the first one I run :

Code:

bash # tcpdump -i eth0 icmp
and in the second one :

Code:

bash # ping -c 2 127.0.0.1
Now the "ping" command works fine, but there is no response from the tcpdump terminal. It remains speechless. I have tried using the -v argument but to no avail.
No firewall/IPTables running and ipconfig indicates NIC is at eth0. If took the liberty of issuing the

Code:

ipconfig lo 127.0.0.1
prior to running both tcpdump and ping.
Any clues ?

Cheers,
Uncle.

anomie 03-05-2007 11:45 AM

uncle-c,

Do you see the problem here? You're telling it to listen on eth0, then you're pinging the loopback device...

uncle-c 03-05-2007 02:48 PM

I altered the command to tcpdump -i 127.0.0.1 icmp ( ping 127.0.0.1) but get adaptor error.
Also tcpdump -i 192.168.0.2 icmp ( the IP address) and ping 192.168.0.2 to no effect. I'm flumoxed, only the solution will help me understand where I'm going wrong !!

anomie 03-05-2007 03:19 PM

Try tcpdump -i lo to listen on the loopback device.

If that doesn't work check the results of ifconfig for the proper name.

uncle-c 03-05-2007 05:30 PM

tcpdump -i lo worked fine when i entered ping 127.0.0.1

but why does it not work when I enter tcpdump -i 127.0.0.1 and ping 127.0.0.1 ?

Thanks again.
Uncle-c

anomie 03-05-2007 05:39 PM

uncle-c, it's a good time to dig into the manpages. It's all there in tcpdump(8).

127.0.0.1 is an IP address, not an interface.

And here is an example for proof:
Code:

[hector@centos1 ~]$ sudo /usr/sbin/tcpdump -D
1.eth0
2.any (Pseudo-device that captures on all interfaces)
3.lo

Next task - look up the -D option in those manpages. ;)

uncle-c 03-05-2007 06:03 PM

Anomie, thanks for directing me onto the correct learning curve ! Much appreciated.
all good wishes
uncle-c


All times are GMT -5. The time now is 01:28 PM.