* [Comm] IPTABLES, разбор ошибок
@ 2003-09-29 19:54 unix9
2003-09-30 3:09 ` Gosha
2003-09-30 3:37 ` Mike Lykov
0 siblings, 2 replies; 13+ messages in thread
From: unix9 @ 2003-09-29 19:54 UTC (permalink / raw)
To: community
Я тут впервые настраиваю шлюз (файрволл и нат, на машине также есть почтовый сервер, днс-сервер и веб)
При запуске скрипта выходит такое сообщение
Bad argument `бродкастовый адрес'
Bad argument `ACCEPT'
Bad argument `ESTABLISHIED,RELATED'
Warning: wierd character in interface `eth0-j' (No aliases, :, ! or *).
Bad argument `tcp_packets'
Warning: wierd character in interface `eth0-j' (No aliases, :, ! or *).
Bad argument `udp_packets'
Bad argument `ACCEPT'
Знатоки подобных вещей объясните где я не прав?
Вот сам скрипт
#!/bin/sh
# Internet Configuration"
INET_IP="реальный адрес"
INET_IFACE="eth0"
INET_BROADCAST="бродкастовый адрес"
# LAN Configuration
LAN IP="192.168.100.6"
LAN_IP_RANGE="192.168.100.0/24"
LAN_BROADCAST_ADDRESS="192.168.100.250"
LAN_IFACE="eth1"
#Localhost Configuration
LO_IFACE="lo"
LO_IP="127.0.0.1"
#IPTABLES
IPTABLES="/sbin/iptables"
# Module loading
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_state
# proc set up
#
#proc "1" > /proc/sys/net/ipv4/ip_forward
# Rules
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP
# Create bad tcp packets
$IPTABLES -N bad_tcp_packets
$IPTABLES -N allowed
$IPTABLES -N tcp_packets
$IPTABLES -N udp_packets
$IPTABLES -N icmp_packets
$IPTABLES -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \
--log-prefix "New not syn:"
$IPTABLES -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP
$IPTABLES -A allowed -p tcp --syn -j ACCEPT
$IPTABLES -A allowed -p tcp -m state --state ESTABLISHED, RELATED -j
ACCEPT
$IPTABLES -A allowed -p tcp -j DROP
# TCP Rules
$IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 21 -j allowed
$IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 22 -j allowed
$IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 80 -j allowed
$IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 110 -j allowed
$IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 113 -j allowed
# UDP ports
$IPTABLES -A udp_packets -p udp -s 0/0 --source-port 2074 -j ACCEPT
$IPTABLES -A udp_packets -p udp -s 0/0 --source-port 4000 -j ACCEPT
$IPTABLES -A udp_packets -p udp -i $INET_IFACE -d -d $INET_BROADCAST \
--destination-port 135:139 -j DROP
$IPTABLES -A udp_packets -p udp -i $INET_IFACE -d 255.255.255.255 \
--destination-port 67:68 -j DROP
# ISMP rules
$IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 8 -j ACCEPT
$IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 11 -J ACCEPT
$IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 0 -j ACCEPT
#INPUT chain
#BAD TCP packets
$IPTABLES -A INPUT -p tcp -j bad_tcp_packets
#Rules for special
$IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LO_IP -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LAN_IP -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $INET_IP -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LAN_IFACE -d $LAN_BROADCAST_ADDRESS -j
ACCEPT
#Rules for incoming from Internet
$IPTABLES -A INPUT -p ALL -d $INET_IP -m state ESTABLISHIED, RELATED \
-j ACCEPT
$IPTABLES -A INPUT -p tcp -i $INET_IFACE-j tcp_packets
$IPTABLES -A INPUT -p udp -i $INET_IFACE-j udp_packets
$IPTABLES -A INPUT -p -i $INET_IFACE -d 224.0.0.0/8 -j DROP
#Log
$IPTABLES -A INPUT -m limit --limit 3/minute --limit-burst 3 -J LOG \
--log-level DEBUG --log-prefix "IPT INPUT packet died:"
#Forward chain
$IPTABLES -A FORWARD -p tcp -J bad_tcp_packets
$IPTABLES -A FORWARD -i $LAN_IFACE -j ACCEPT
$IPTABLES -A FORWARD -m state --state ESTABLISHIED, RELATED -j ACCEPT
#Log
$IPTABLES -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-level DEBUG --log-prefix "IPT FORWARD packets died: "
#Badtcppacketswe don`t wont
$IPTABLES -A OUTPUT -p ALL -s $LO_IP -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $LAN_IP -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $INET_IP -j ACCEPT
$IPTABLES -A OUTPUT -m limit --limit 3/minite --limit-burst 3 -j LOG \
--log-level DEBUG --log-prefix "IPT OUTPUT packet died: "
$IPTABLES -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -s 192.168.100.0/24 --out-interface eth0 -j
SNAT --to-source $INET_IP
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-29 19:54 [Comm] IPTABLES, разбор ошибок unix9
@ 2003-09-30 3:09 ` Gosha
2003-09-30 3:14 ` Gosha
2003-09-30 3:37 ` Mike Lykov
1 sibling, 1 reply; 13+ messages in thread
From: Gosha @ 2003-09-30 3:09 UTC (permalink / raw)
To: community
Hi!
On Mon, 29 Sep 2003 23:54:56 +0400 (MSD)
"unix9" <unix9@yandex.ru> wrote:
> Я тут впервые настраиваю шлюз (файрволл и нат, на машине также есть
> почтовый сервер, днс-сервер и веб)
>
> При запуске скрипта выходит такое сообщение
>
> Bad argument `бродкастовый адрес'
В качестве `бродкастовый адрес' прописан реальный
броадкастовый адрес надеюсь? Без ошибок. :-)
> Bad argument `ACCEPT'
тут трудно что либо сказать
> Bad argument `ESTABLISHIED,RELATED'
а если попробовать правильно написать слово "ESTABLISHED" ? :-)))
> Warning: wierd character in interface `eth0-j' (No aliases, :, ! or
> *). Bad argument `tcp_packets'
> Warning: wierd character in interface `eth0-j' (No aliases, :, ! or
> *). Bad argument `udp_packets'
> Bad argument `ACCEPT'
Банальная ошибка. Отсутствует пробел.
Вместо `eth0-j' должно быть `eth0 -j'
> Знатоки подобных вещей объясните где я не прав?
Просто будьте повнимательней. :-)
--
Best regards!
Igor Solovyov
System/Network administrator
JSC CB "Zlatkombank", Zlatoust, Russia
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-30 3:09 ` Gosha
@ 2003-09-30 3:14 ` Gosha
0 siblings, 0 replies; 13+ messages in thread
From: Gosha @ 2003-09-30 3:14 UTC (permalink / raw)
To: community
Hi!
On Tue, 30 Sep 2003 09:09:25 +0600
Gosha <gosha@zkb.ru> wrote:
> > Я тут впервые настраиваю шлюз (файрволл и нат, на машине также есть
> > почтовый сервер, днс-сервер и веб)
> >
> > При запуске скрипта выходит такое сообщение
> >
> > Bad argument `бродкастовый адрес'
>
> В качестве `бродкастовый адрес' прописан реальный
> броадкастовый адрес надеюсь? Без ошибок. :-)
Нашел ошибку:
$IPTABLES -A udp_packets -p udp -i $INET_IFACE -d -d $INET_BROADCAST \
--destination-port 135:139 -j DROP
Два раза подряд -d -d прописано.
В общем выгребайте ошибки. :-))))
--
Best regards!
Igor Solovyov
System/Network administrator
JSC CB "Zlatkombank", Zlatoust, Russia
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-29 19:54 [Comm] IPTABLES, разбор ошибок unix9
2003-09-30 3:09 ` Gosha
@ 2003-09-30 3:37 ` Mike Lykov
2003-09-30 3:55 ` Gosha
2003-09-30 6:28 ` [Comm] IPTABLES,разбор ошибок unix9
1 sibling, 2 replies; 13+ messages in thread
From: Mike Lykov @ 2003-09-30 3:37 UTC (permalink / raw)
To: community
В сообщении от Вторник 30 Сентябрь 2003 00:54 unix9 написал:
> Bad argument `бродкастовый адрес'
> # Internet Configuration"
> INET_IP="реальный адрес"
> INET_IFACE="eth0"
> INET_BROADCAST="бродкастовый адрес"
смеетесь, что ли?
iptables не понимает по русски ;)
--
Mike
registered linux user #315334
jabber id: combr@jabber.ru
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-30 3:37 ` Mike Lykov
@ 2003-09-30 3:55 ` Gosha
2003-09-30 4:48 ` Mike Lykov
2003-09-30 6:28 ` [Comm] IPTABLES,разбор ошибок unix9
1 sibling, 1 reply; 13+ messages in thread
From: Gosha @ 2003-09-30 3:55 UTC (permalink / raw)
To: community
Hi!
On Tue, 30 Sep 2003 08:37:53 +0500
Mike Lykov <combr@vesna.ru> wrote:
> > INET_IP="реальный адрес"
> > INET_IFACE="eth0"
> > INET_BROADCAST="бродкастовый адрес"
>
> смеетесь, что ли?
> iptables не понимает по русски ;)
Он просто не стал публиковать реальные адреса (и правильно сделал),
на самом деле в скрипте вместо русских слов стоят реальные адреса.
Надеюсь. :-)))
--
Best regards!
Igor Solovyov
System/Network administrator
JSC CB "Zlatkombank", Zlatoust, Russia
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-30 3:55 ` Gosha
@ 2003-09-30 4:48 ` Mike Lykov
2003-09-30 6:55 ` Igor Solovyov
0 siblings, 1 reply; 13+ messages in thread
From: Mike Lykov @ 2003-09-30 4:48 UTC (permalink / raw)
To: community
В сообщении от Вторник 30 Сентябрь 2003 08:55 Gosha написал:
> Hi!
> On Tue, 30 Sep 2003 08:37:53 +0500
> > > INET_BROADCAST="бродкастовый адрес"
> > смеетесь, что ли?
> > iptables не понимает по русски ;)
> Он просто не стал публиковать реальные адреса (и правильно сделал),
> на самом деле в скрипте вместо русских слов стоят реальные адреса.
> Надеюсь. :-)))
а ОТКУДА тогда:
Bad argument `бродкастовый адрес'
А?? ;))) так что можно не надеяться ;)
--
Mike
registered linux user #315334
jabber id: combr@jabber.ru
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES, разбор ошибок
2003-09-30 4:48 ` Mike Lykov
@ 2003-09-30 6:55 ` Igor Solovyov
0 siblings, 0 replies; 13+ messages in thread
From: Igor Solovyov @ 2003-09-30 6:55 UTC (permalink / raw)
To: community
Hi!
On Tue, 30 Sep 2003 09:48:55 +0500
Mike Lykov <combr@vesna.ru> wrote:
> а ОТКУДА тогда:
>
> Bad argument `бродкастовый адрес'
>
> А?? ;))) так что можно не надеяться ;)
Да просто он и в сообщении об ошибке заменил реальные
адреса этой надписью.
:-)
--
Best regards!
Igor Solovyov
System/network administrator
JSC CB "Zlatkombank"
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES,разбор ошибок
2003-09-30 3:37 ` Mike Lykov
2003-09-30 3:55 ` Gosha
@ 2003-09-30 6:28 ` unix9
2003-09-30 14:02 ` unix9
1 sibling, 1 reply; 13+ messages in thread
From: unix9 @ 2003-09-30 6:28 UTC (permalink / raw)
To: community
>В сообщении от Вторник 30 Сентябрь 2003 00:54 unix9 написал:
>
>> Bad argument `бродкастовый адрес'
>
>> # Internet Configuration"
>> INET_IP="реальный адрес"
>> INET_IFACE="eth0"
>> INET_BROADCAST="бродкастовый адрес"
>
>смеетесь, что ли?
>
>iptables не понимает по русски ;)
да нет конечно, не смеюсь я. просто специально сюда его не писал.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES,разбор ошибок
2003-09-30 6:28 ` [Comm] IPTABLES,разбор ошибок unix9
@ 2003-09-30 14:02 ` unix9
2003-09-30 16:29 ` Igor Solovyov
2003-09-30 17:10 ` [Comm] IPTABLES,разбор ошибок Пирогов Алексей
0 siblings, 2 replies; 13+ messages in thread
From: unix9 @ 2003-09-30 14:02 UTC (permalink / raw)
To: community
такс, внес исправления, запускаю, ошибок не выводит.
но почему то по команде ps -aux я не вижу этого процесса. Почему так?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES,разбор ошибок
2003-09-30 14:02 ` unix9
@ 2003-09-30 16:29 ` Igor Solovyov
2003-09-30 18:35 ` [Comm]IPTABLES,разбор ошибок unix9
2003-09-30 17:10 ` [Comm] IPTABLES,разбор ошибок Пирогов Алексей
1 sibling, 1 reply; 13+ messages in thread
From: Igor Solovyov @ 2003-09-30 16:29 UTC (permalink / raw)
To: community
Hi!
On Tue, 30 Sep 2003 18:02:21 +0400 (MSD)
"unix9" <unix9@yandex.ru> wrote:
> такс, внес исправления, запускаю, ошибок не выводит.
>
> но почему то по команде ps -aux я не вижу этого процесса. Почему так?
А попробуй сделать:
# iptaibls -nL
:-)))
--
Best regards!
Igor Solovyov
System/network administrator
JSC CB "Zlatkombank"
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Comm] IPTABLES,разбор ошибок
2003-09-30 14:02 ` unix9
2003-09-30 16:29 ` Igor Solovyov
@ 2003-09-30 17:10 ` Пирогов Алексей
2003-09-30 18:39 ` [Comm] IPTABLES,=?koi8-r?b?0sHaws/S?= ошибок unix9
1 sibling, 1 reply; 13+ messages in thread
From: Пирогов Алексей @ 2003-09-30 17:10 UTC (permalink / raw)
To: community
В сообщении от 30 Сентябрь 2003 17:02 unix9 написал(a):
> но почему то по команде ps -aux я не вижу этого процесса. Почему так?
а какой процесс ты хочешь увидеть? iptables?!?!?!?!
--
Наилучшие пожелания, Registered .--.
Пирогов Алексей Linux User #293162 |@_@ |
mailto:ipalex@ukr.net |!_/ |
mailto:ipalex@ferplast.com.ua // \ \
(AlekseyPirogov@ferplast.com.ua) (| | )
UIN:172368093 /'\_ _/`\
Powered by Linux \___)=(___/
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2003-09-30 18:39 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-29 19:54 [Comm] IPTABLES, разбор ошибок unix9
2003-09-30 3:09 ` Gosha
2003-09-30 3:14 ` Gosha
2003-09-30 3:37 ` Mike Lykov
2003-09-30 3:55 ` Gosha
2003-09-30 4:48 ` Mike Lykov
2003-09-30 6:55 ` Igor Solovyov
2003-09-30 6:28 ` [Comm] IPTABLES,разбор ошибок unix9
2003-09-30 14:02 ` unix9
2003-09-30 16:29 ` Igor Solovyov
2003-09-30 18:35 ` [Comm]IPTABLES,разбор ошибок unix9
2003-09-30 17:10 ` [Comm] IPTABLES,разбор ошибок Пирогов Алексей
2003-09-30 18:39 ` [Comm] IPTABLES,=?koi8-r?b?0sHaws/S?= ошибок unix9
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git