LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2007, 12:58 AM   #1
mmiikkee12
LQ Newbie
 
Registered: Oct 2006
Location: Earth
Distribution: Between distros
Posts: 14

Rep: Reputation: 0
iptables rejecting my configuration


I'm running Arch Linux, and wanted to set up a firewall and share my connection with another computer connected through a crossover cable.

The problem is that restarting iptables gives a "line 24 failed" error. (line 24 is the COMMIT line.) Anything wrong with this rules file?
Code:
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]

# ICMP packets
-A INPUT -p icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp --icmp-type 11 -j ACCEPT

# Only one ping per second
-A INPUT -p icmp --icmp-type 8 -m limit --limit 1/second -j ACCEPT

# http
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# allow all packets from localhost or the other computer
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -j ACCEPT

COMMIT
For the connection sharing I took a script I wrote a few months ago and adapted it slightly to Arch. Would this work?:
Code:
#!/bin/bash

ifconfig eth0 192.168.0.1 netmask 255.255.255.0
/etc/rc.d/dhcpd start
/etc/rc.d/named start
iptables -t nat -I POSTROUTING 1 -o eth0 -j MASQUERADE
iptables -P FORWARD ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
 
Old 07-21-2007, 01:12 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Seen this before in Redhat and when I compiled my own kernels. Seems many changes have occured to netfilter since 2.6.16 and I had to enable the correct modules and some required to be in the kernel. Search here or google for help there.

For the script, it looks fine. Only thing I would do is use the full path to the commands like iptables would be /sbin/iptables.

Brian
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables Configuration? SBN Linux - Security 6 11-13-2006 09:33 PM
Iptables configuration gurl4sh25 Linux - Security 5 10-10-2006 01:20 AM
iptables configuration linuxhippy Slackware 11 03-18-2006 03:59 PM
iptables configuration crazyjedi Linux - Newbie 2 03-15-2006 02:17 AM
iptables configuration know Linux - Networking 2 05-25-2003 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration