Skip to contentSkip to conversation

I need help , please

DISCUSSION david 3 participants 9 messages Jul 4, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

david

author
#1 lore raw

It was a mistake.What I do is

# service iptables save
after that  I got a new file in /etc/sysconfig/iptables .
and then :
#/etc/rc.d/init.d/iptables restart 2>salida8
.And here you see all the errors.

david

----- Original Message -----
From: jesse.linux
To: [email protected]
Sent: Thursday, July 04, 2002 8:13 AM
Subject: RE: I need help , please

if u want to use iptables, why did u restart ipchains?...

pls give more info...

From: "david" <[email protected]>
To: <[email protected]>
Subject: I need help , please
Date: Wed, 3 Jul 2002 08:47:57 +0200

This is a multi-part message in MIME format.

------=_NextPart_000_0053_01C2226E.542764D0
Content-Type: multipart/alternative; boundary="----=_NextPart_001_0054_01C2226E.542764D0"

------=_NextPart_001_0054_01C2226E.542764D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi:
=20
I have been using ipchains for a long time , but know i want to turn to = iptables.
I have a script file in /etc/rc.d/init.d/iptables

What I do is :

  # service iptables save
  =20
  after that  I got a new file in /etc/sysconfig/iptables .
  and then :

#/etc/rc.d/init.d/ipchains restart
=20
First I got a lot of errrors and it does not seem to apply my rules, = because if for example ,I comment (#) the rules for http client , it = allow me to get the web anyway.

#2 lore raw
Quoted 7 lines · david

It was a mistake.What I do is

# service iptables save
after that  I got a new file in /etc/sysconfig/iptables .
and then :
#/etc/rc.d/init.d/iptables restart 2>salida8
.And here you see all the errors.

What rules are you trying to set ?

Have you compiled all the required bits of iptables into the kernel or are you loading modules ?

Antony.

author
#3 lore raw

I amtrying to set a dns and proxy server

----- Original Message -----
From: "Antony Stone" <[email protected]>
To: <[email protected]>
Sent: Thursday, July 04, 2002 4:53 PM
Subject: Re: I need help , please

Quoted 18 lines · david
Quoted 8 lines

It was a mistake.What I do is

# service iptables save
after that  I got a new file in /etc/sysconfig/iptables .
and then :
#/etc/rc.d/init.d/iptables restart 2>salida8
.And here you see all the errors.

What rules are you trying to set ?

Have you compiled all the required bits of iptables into the kernel or are you loading modules ?

Antony.

#4 lore raw
Quoted 1 line · david

I amtrying to set a dns and proxy server

I assume this means you want to run DNS and an http proxy such as squid on
the machine running the Firewall. If this is not correct, post again and
tell us what iptables rules you are trying to set up (which is what I was trying to ask).

Anyway, if that is the correct assumption, how about a set of rules such as this ?

# Standard default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# Allow in DNS requests
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -j ACCEPT
# Allow out DNS requests
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Redirect http requests to local proxy
iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80 # Allow proxy requests out of machine
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
# Allow replies etc back in again
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Antony.

Quoted 23 lines

----- Original Message -----
From: "Antony Stone" <[email protected]>
To: <[email protected]>
Sent: Thursday, July 04, 2002 4:53 PM
Subject: Re: I need help , please

Quoted 17 lines · david
Quoted 7 lines

It was a mistake.What I do is

# service iptables save
after that  I got a new file in /etc/sysconfig/iptables .
and then :
#/etc/rc.d/init.d/iptables restart 2>salida8
.And here you see all the errors.

What rules are you trying to set ?

Have you compiled all the required bits of iptables into the kernel or are you loading modules ?

Antony.

#5 lore raw
Quoted 11 lines · Antony Stone
Quoted 1 line · david

I amtrying to set a dns and proxy server

I assume this means you want to run DNS and an http proxy such as squid on
the machine running the Firewall. If this is not correct, post again and
tell us what iptables rules you are trying to set up (which is what I was trying to ask).

Anyway, if that is the correct assumption, how about a set of rules such as this ?

Quoted 12 lines

# Standard default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# Allow in DNS requests
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -j ACCEPT
# Allow out DNS requests
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Redirect http requests to local proxy
iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80

Anthony, just for my understanding: is this any different from:

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT ?

Jan Humme.

#6 lore raw
Quoted 8 lines · Jan Humme
Quoted 2 lines · Antony Stone

# Redirect http requests to local proxy
iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80

Antony, just for my understanding: is this any different from:

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT ?

No. I just find the name 'redirect' a bit ambiguous (I mean, it could
redirect it somewhere else, couldn't it, but no, it only redirects it to the local machine...) therefore I use DNAT which I'm familiar with from other uses.

Antony.

#7 lore raw
Quoted 5 lines · Antony Stone
Quoted 4 lines · Jan Humme
Quoted 2 lines · Antony Stone

# Redirect http requests to local proxy
iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80

Quoted 8 lines
Quoted 3 lines

Antony, just for my understanding: is this any different from:

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT ?

No. I just find the name 'redirect' a bit ambiguous (I mean, it could
redirect it somewhere else, couldn't it, but no, it only redirects it to the local machine...) therefore I use DNAT which I'm familiar with from other uses.

OK, and agree.

But I am somewhat surprised to find such redundant syntax at this level.

Jan Humme.

#8 lore raw
Quoted 10 lines · Jan Humme
Quoted 9 lines · Antony Stone
Quoted 7 lines · Jan Humme
Quoted 2 lines · Antony Stone

# Redirect http requests to local proxy
iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80

Antony, just for my understanding: is this any different from:

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT ?

Quoted 8 lines
Quoted 4 lines

No. I just find the name 'redirect' a bit ambiguous (I mean, it could
redirect it somewhere else, couldn't it, but no, it only redirects it to the local machine...) therefore I use DNAT which I'm familiar with from other uses.

OK, and agree.

But I am somewhat surprised to find such redundant syntax at this level.

I could have written it as

iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1

if you prefer :-)

Antony.

#9 lore raw
Quoted 19 lines · Antony Stone
Quoted 18 lines · Jan Humme
Quoted 6 lines · Antony Stone
Quoted 5 lines · Jan Humme
Quoted 3 lines · Antony Stone

# Redirect http requests to local proxy iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1:80

Quoted 8 lines
Quoted 3 lines

Antony, just for my understanding: is this any different from:

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT ?

No. I just find the name 'redirect' a bit ambiguous (I mean, it could
redirect it somewhere else, couldn't it, but no, it only redirects it to the local machine...) therefore I use DNAT which I'm familiar with from other uses.

OK, and agree.

Quoted 7 lines
Quoted 1 line

But I am somewhat surprised to find such redundant syntax at this level.

I could have written it as

iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT 127.0.0.1

if you prefer :-)

I was in fact refering to the redundant design of the iptables syntax, and not to your beautiful piece of nat-art, Anthony ;-) !

Jan Humme.