Solved

ipchains

Posted on 2001-07-24
5
368 Views
Last Modified: 2013-12-16
I've read a few books already about "ipchains" However, when I configure my firewall script using the examples in a few books (obviously substituting the author's info with my info), it never works. If I open up the firewall completely, it works and internet connection sharing is no problem. But when I try to lock down the system the way I see in the books, it never works. Does anyone have a good ipchains example that works with Redhat 6.x and on a box that utilizes DHCP from the ISP? Thanks mucho...

0
Comment
Question by:jackiethejokeman
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:garisoain
ID: 6315775
Hey there...

sure... What you need exactly?

what are you doing now?
what are you trying to do?

a good start is the Ipchains-HOWTO:
http://www.linuxdoc.org/HOWTO/IPCHAINS-HOWTO.html
=)
0
 
LVL 1

Accepted Solution

by:
fobzz earned 50 total points
ID: 6316211
IPCHAINS are easy to understand once you get the "jist" of commands you need for the script. Just remember this... there are only two chains: "input" and "output" chain. Now, you can accept, deny, or filter whatever packet enters, leaves, or passes through an IP address(s)/Network card(s). Check out this link for a really easy discription of what you should know about IPCHAINS: http://www.linuxplanet.com/linuxplanet/tutorials/2100/3/
It is a little easier to understand for most people.

Another thing I would recommend is upgrading to IPTABLES or upgrading to a newer distribution with IPTABLES. IPTABLES have much more functionality to it, yet similar configurations as IPCHAINS. If you are interested, please feel free to check out this link:
http://www.linuxnewbie.org/nhf/intel/security/iptables_basics.html
It has some additional links for more indepth information.

I hope I helped.........................................
0
 
LVL 4

Expert Comment

by:garisoain
ID: 6317410
Well, there aren't only 2 chains... by default there are 3: INPUT, OUTPUT, and FORWARD, and you can create all the chains you want to make your firewall as CUSTOM as possible, AND you can do more than 'Accept, Deny or Filter' (even when these are the 3 main choices).

I agree that IPTABLES is a better firewall implementation than IPCHAINS, but in order to use IPTABLES you need to upgrade your kernel to 2.4.x, and several other packages, unless you install a Distro that includes a 2.4.x kernel.

just to comment.

-garisoain
0
 
LVL 1

Expert Comment

by:fobzz
ID: 6319119
That is true...thanks for clarifying that, it was a little late when I posted that. I was just trying to explain to "jackiethejokeman" just the basics to build on. I forgot about the foward chain.
0
 
LVL 5

Expert Comment

by:paulqna
ID: 6319247
The way I use ipchains with my "dhcp provider" was to accept allow only connections to the local network (example 195.195.0.0) to be made:

like :

# Begin ipchains script
#
# Closing all interfaces
#
ipchains -P input DENY
ipchains -P output DENY
ipchains -P forward DENY
#
# Allow lo interface (REQUIRED!)
#
ipchains -A input -j ACCEPT -i lo
ipchains -A output -j ACCEPT -i lo
#
# Allow 10.10.10.0 subnet. (FULL ACCESS)
#
ipchains -A input -j ACCEPT -s 10.10.10.0/24 -d 10.10.10.0/24 -i eth0
ipchains -A output -j ACCEPT -s 10.10.10.0/24 -d 10.10.10.0/24 -i eth0
#
# Open http (FOR Example)
#
ipchains -A input -j ACCEPT -p tcp -s 0.0.0.0/0 80:80 \
-d 195.195.0.0/16 1024:5000 -i ppp0
ipchains -A output -j ACCEPT -p tcp -s 195.195.0.0/16 1024:5000 \
-d 0.0.0.0/0 80:80 -i ppp0
#
# End ipchains script

instead of using my ppp0 host ip.

Doing this your linux machine can only connect to ip adresses starting with 10.10.10 and browse to the rest of the world(network).
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get maximum transfer speed over LAN 4 104
HOw To Install Docker on VMware Workstation 19 170
IP 10.0.1.2 / 255.0.0.0 61 56
Post Clonezilla image restore issue 6 36
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question