old-www/LDP/solrhe/Securing-Optimizing-Linux-R.../chap12sec108.html

276 lines
4.9 KiB
HTML

<HTML
><HEAD
><TITLE
>IPCHAINS Administrative Tools</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Securing and Optimizing Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="Networking Firewall -Masquerading and Forwarding"
HREF="Masq-forward.html"><LINK
REL="PREVIOUS"
TITLE="Deny access to some address"
HREF="chap12sec107.html"><LINK
REL="NEXT"
TITLE="Software -Security"
HREF="soft-secure.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Securing and Optimizing Linux: RedHat Edition -A Hands on Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chap12sec107.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 12. Networking Firewall -Masquerading and Forwarding</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="soft-secure.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN6923"
>12.5. <TT
CLASS="literal"
>IPCHAINS</TT
> Administrative Tools</A
></H1
><P
>&#13; The commands listed below are some tools that we use often, but many more exist, and you should check the man page and documentation for more details and information. The ipchains tool is used for
the firewall administration of the Linux system. We can use it to set up a firewall rules file, as we are doing in this book. Once firewall rules have been created we can play
with its many commands to maintain, and inspect its rules in the Linux kernel.
</P
><P
>&#13; To list all rules in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -L
</PRE
></TD
></TR
></TABLE
>
This command will list all rules in the selected chain. If no chain is selected, all chains are listed.
</P
><P
>&#13; To list all input rules in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -L input
</PRE
></TD
></TR
></TABLE
>
This command will list all input rules we have configured in the selected chain.
</P
><P
>&#13; To list all output rules in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -L output
</PRE
></TD
></TR
></TABLE
>
This command will list all output rules we have configured in the selected chain.
</P
><P
>&#13; To list all forward rules in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -L forward
</PRE
></TD
></TR
></TABLE
>
This command will list all forward rules in the selected chain. This of course works only if you have configured Masquerading on your server. <EM
>for gateway servers in general</EM
>.
</P
><P
>&#13; To list all masquerades rules in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -ML
</PRE
></TD
></TR
></TABLE
>
This option allows viewing of the currently masqueraded connections. You must have configured Masquerading on your server for this command to work, <EM
>once again, only for gateway servers</EM
>.
</P
><P
>&#13; To list all rules in numeric output in the selected chain, use the command:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13; [root@deep] /# <B
CLASS="command"
>ipchains</B
> -nL
</PRE
></TD
></TR
></TABLE
>
This command will list all rules in numeric output. All the <SPAN
CLASS="acronym"
>IP</SPAN
> addresses and port numbers will be printed in numeric format.
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chap12sec107.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="soft-secure.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Deny access to some address</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="Masq-forward.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Software -Security</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>