iptables -L -n -v

View firewall config including devices on linux w/netfilter

I was previously unaware of the -v switch. As a result I never got specifics about which interfaces the allowed or dropped applied to. Thought I'd share the wealth... FYI, -n prevents DNS resolving of IPs.

0
By: gpenguin
2009-10-07 21:13:59

These Might Interest You

  • Shows how many Windows and Linux devices are on your network. May add support for others, but that's all that are on my network right now. Show Sample Output


    3
    sudo nmap -F -O 192.168.1.1-255 | grep "Running: " > /tmp/os; echo "$(cat /tmp/os | grep Linux | wc -l) Linux device(s)"; echo "$(cat /tmp/os | grep Windows | wc -l) Window(s) devices"
    matthewbauer · 2010-01-10 03:09:56 2
  • file(1) can print details about certain devices in the /dev/ directory (block devices in this example). This helped me to know at a glance the location and revision of my bootloader, UUIDs, filesystem status, which partitions were primaries / logicals, etc.. without running several commands. See also: file -s /dev/dm-* file -s /dev/cciss/* etc.. Show Sample Output


    24
    file -s /dev/sd*
    mhs · 2010-12-28 09:56:03 0
  • connect to it with any network command (including web browser - if you don't mind weird formatting) curl 127.0.0.1:9876 nc 127.0.0.1 9876 Show Sample Output


    5
    mkfifo /tmp/view; nc -l 9876 < /tmp/view& script -f /tmp/view
    snipertyler · 2014-06-23 05:06:13 1

  • -3
    iptables -L -n -v
    RonaldConco · 2009-02-16 11:00:37 2
  • This dumps all of your installed perl's config information.


    0
    perl -le 'use Config; foreach $i (keys %Config) {print "$i : @Config{$i}"}'
    chuckr · 2009-09-22 22:14:21 0
  • This command will use the fdisk utility to find all block devices on your system, and overwrite them with data from the /dev/urandom non-blocking random number generator. CAUTION: This will irrevocably erase EVERY SINGLE physical block storage device visible to the fdisk utility, including plugged USB devices, RAID sets, LVM, etc. Show Sample Output


    1
    for i in `sudo /sbin/fdisk -l |grep Disk |grep dev |awk '{ print $2 }' |sed s/://g` ; do sudo /usr/bin/dd if=/dev/urandom of=$i bs=8M & done
    aimana007 · 2014-03-16 12:04:59 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: