Solved

ipchains

Posted on 2001-07-24
5
364 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why VNC doesn't work in Redhat? 11 43
Apache timeout remote connection if not port 80 10 72
bash script question (chmod) 10 56
su - oracle could not open session 6 52
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now