To see the current firewall configuration of your machine, you can type
iptables -L -nv –line-numbers | less
but if you’re like me, you probably don’t want to have to type a long mess
like this. What I’ve done is to create a set of aliases and save them in the
file /etc/bash.bashrc.local so that I can run the previous command with far
fewer keystrokes. The bash.bashrc.local file doesn’t exist by default, so
you’ll need to create it. Put the following lines in it and then save it:
alias less=’less -S’
alias iptables=’/usr/sbin/iptables’
alias fws=’iptables -L -nv –line-numbers | less’
The next time you open a bash shell, this file will be read and the aliases
will be ready to use. The first line configures the pager command “less” so
that it doesn’t wrap lines that are longer than the screen width. This makes
it a lot easier to read the output, and you can use the left and right arrow
keys to see the long lines. The second line isn’t really necessary, as the
iptables command should already be in the path of the root user. The third
line is the one that shows you the firewall rules. I used the alias “fws” to
stand for “firewall show”, but you can call it whatever you want.
file provided by SuSE). It’s reasonably commented, but let me know if you
have any questions.
Leave a Reply