Форум русскоязычного сообщества Ubuntu


Хотите сделать посильный вклад в развитие Ubuntu и русскоязычного сообщества?
Помогите нам с документацией!

Автор Тема: HOWTO: USB ADSL (Zyxel, Acorp etc.) - 7 простых шагов к Интернету  (Прочитано 79835 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн danilich

  • Новичок
  • *
  • Сообщений: 26
    • Просмотр профиля
Мда. Я решил после пятилетнего перерыва посмотреть, как идут дела у Linuxа, и вижу, что ничего не поменялось. Снова танцы с бубнами вокруг простейших процедур, вплоть до "сделать самому". Что ж, спасибо хотя бы, что откликнулись.
поменяется очень быстро при запрете консоли, наложение на нее проклятия и публичное осмеяние тех, кто про нее заикнется
у-б-у-н-т-у  ш-м-у-б-у-н-т-у  8 + какие-то еще цифры

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
господа у кого с модемом ZyXEL OMNI ADSL USB EE firewall настроен?

у меня проблема скрипт настройка firewall-а не запускается ругается на отсутствие ppp0 хотя инет есть и squid работает

root@ubuntu:/etc# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:E7:69:B8
          inet addr:10.10.ххх.ххх  Bcast:10.10.ххх.ххх  Mask:255.255.255.0
          inet6 addr: fe80::20c:6eff:fee7:69b8/64 Диапазон:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36580 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16210 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4149951 (3.9 MiB)  TX bytes:14118918 (13.4 MiB)
          Interrupt:17 Base address:0xe800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Диапазон:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

nas0      Link encap:Ethernet  HWaddr 00:13:49:35:D0:45
          inet6 addr: fe80::213:49ff:fe35:d045/64 Диапазон:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24749 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23622 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13995568 (13.3 MiB)  TX bytes:3238343 (3.0 MiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:yyy.yyy.yyy.yyy  P-t-P:yyy.yyy.yyy.yyy  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:11831 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11210 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:10822323 (10.3 MiB)  TX bytes:1911055 (1.8 MiB)

Оффлайн ais77

  • Автор темы
  • Участник
  • *
  • Сообщений: 186
  • linux blondy
    • Просмотр профиля
А что за скрипт/файерволл такой? В модеме что-то?
сравнил со своим ifconfig - все аналогично

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
пробовал ставит пакет arno-iptables-firewall для настройки iptables вроде все гладко проходит а нат не запускается
тогда решил iptables в ручную настроить вотконфиг:

#!/bin/sh
############################################################################
# 1.1 Настройки интернет.

INET_IP="10.91.0.171"
INET_IFACE="ppp0"
############################################################################
# 1.2 Настройки локальной сети.

LAN_IP="10.10.1.28"
LAN_IP_RANGE="10.10.1.0/24"
LAN_IFACE="eth0"



############################################################################

############################################################################

#
# 1.5 Путь к файлу iptables (обычно "/usr/sbin/iptables" или "/sbin/iptables").
#

IPTABLES="/sbin/iptables"

# Очистка...

$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F

$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X

#
# 1.6 Дополнительно.
#



# Описываем адреса, которые нам могут пригодиться.
# Тут будут те адреса, до которых доступ будет всегда и у всех,
# независимо от того, можно им в инет, или нет.



# Банк-клиенты.

IP_BANK="195.54.3.240"


###########################################################################
#
# 2. Подгрузка модулей.
#

#
# Проверка зависимостей модулей.
#

#/sbin/depmod -a

#
# 2.1 Подгрузка необходимых модулей (нужное раскомментировать).
#

/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
#/sbin/modprobe ipt_owner
#/sbin/modprobe ipt_REJECT
#/sbin/modprobe ipt_MASQUERADE
#/sbin/modprobe ip_conntrack_ftp
#/sbin/modprobe ip_conntrack_irc
#/sbin/modprobe ip_nat_ftp
#/sbin/modprobe ip_nat_irc


# 4. Настройка правил.
#

#
# 4.1 Таблица Filter
#

#
# 4.1.1 Политики по умолчанию
#

$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP

#
# 4.1.2 Создание пользовательских цепочек
#

#
# Создание цепочки для "плохих" пакетов
#

$IPTABLES -N bad_tcp_packets

#
# Создание отдельных цепочек для различных протоколов
#

$IPTABLES -N allowed
$IPTABLES -N tcp_packets
$IPTABLES -N udp_packets
$IPTABLES -N icmp_packets


#
# 4.1.3 Содержимое пользовательских цепочек
#


#
# Цепочка bad_tcp_packets
#
# Отфильтровываются все пакеты, которые распознаются как NEW, но не
# являются SYN пакетами, а также обрабатываются SYN/ACK пакеты,
# имеющие статус NEW.
# Эта цепочка может быть использована для защиты от вторжения
# и сканирования портов.
#

$IPTABLES -A bad_tcp_packets -p tcp --tcp-flags SYN,ACK SYN,ACK \
-m state --state NEW -j REJECT --reject-with tcp-reset
$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

#
# Цепочка allowed
#
# Дополнительная проверка.
# По задумке цепочка вызывается из цепочки tcp_packets, на прошедшие
# проверку пакеты.

# Проверяем, является ли пакет SYN пакетом, т.е. запросом на соединение.
$IPTABLES -A allowed -p TCP --syn -j ACCEPT

# Пропускаем все пакеты с признаком ESTABLISHED и RELATED.
$IPTABLES -A allowed -p TCP -m state --state ESTABLISHED,RELATED -j ACCEPT

# Сбрасываем все остальные пакеты.
$IPTABLES -A allowed -p TCP -j DROP

#
# Цепочка tcp_packets
#
# По идее рулит входящими tcp пакетами из инета.
# Но поскольку у нас нет никаких инет-сервисов в локалке
# мы просто перекидываем все пакеты в allowed.

$IPTABLES -A tcp_packets -j allowed


#
# 4.1.4 Цепочка INPUT.
#

#
# Фильтруем "плохие пакеты" через цепочку bad_tcp_packets.
#

$IPTABLES -A INPUT -p tcp -j bad_tcp_packets

#
# Правила для "своих" сетей, т.е. не для интернета.
#

$IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $INET_IFACE -j ACCEPT

#
# Правила для пакетов, приходящих их интернета.
#

$IPTABLES -A INPUT -p ALL -d $INET_IP -m state --state ESTABLISHED,RELATED \
-j ACCEPT

# Отправляем tcp пакеты в соответствующую цепочку.
$IPTABLES -A INPUT -p TCP -i $INET_IFACE -j tcp_packets

# Отправляем udp пакеты в соответствующую цепочку.
$IPTABLES -A INPUT -p UDP -i $INET_IFACE -j udp_packets

# Отправляем icmp пакеты в соответствующую цепочку.
$IPTABLES -A INPUT -p ICMP -i $INET_IFACE -j icmp_packets

#
# Клиенты Microsoft Network имеют дурную привычку выдавать огромное количесво
# групповых пакетов в диапазоне адресов 224.0.0.0/8. Поэтому можно использовать данное
# правило для предотвращения засорения логов, в случае, если с внешней стороны
# имеется какая либо сеть Microsoft Network. Подобную же проблему решают два последних
# правила в цепочке udp_packets.
#

$IPTABLES -A INPUT -i $INET_IFACE -d 224.0.0.0/8 -j DROP

#
# Весь отбрасываемый траффик журналируется.
#

$IPTABLES -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-level DEBUG --log-prefix "IPT INPUT packet died: "

#
# 4.1.5 Цепочка FORWARD.
#

# Фильтруем "плохие пакеты".

$IPTABLES -A FORWARD -p tcp -j bad_tcp_packets

# Пропускаем пакеты на известные и разрешенные хосты.

$IPTABLES -A FORWARD -i $LAN_IFACE -d $IP_BANK -j ACCEPT

# Пропускаем ответные пакеты в локальную сеть.

$IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

#
# Весь отбрасываемый траффик журналируется.
#

$IPTABLES -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-level DEBUG --log-prefix "IPT FORWARD packet died: "

#
# 4.1.6 Цепочка OUTPUT.
#

#
# Фильтруем "плохие пакеты".
#

$IPTABLES -A OUTPUT -p tcp -j bad_tcp_packets

#
# Правила OUTPUT, определяющие, какие IP будут допущены.
#


$IPTABLES -A OUTPUT -p ALL -s $LAN_IP -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s $INET_IFACE -j ACCEPT

#
# Весь отбрасываемый траффик журналируется.
#

$IPTABLES -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
--log-level DEBUG --log-prefix "IPT OUTPUT packet died: "

######
# 4.2 Таблица nat.
#

#
# 4.2.1 Задаем политики по умолчанию.
#

#
# 4.2.2 Создаем пользовательские цепочки.
#


#
# 4.2.3 Содежимое пользовательских цепочек.
#

#
# 4.2.4 Цепочка PREROUTING.
#


$IPTABLES -t nat -A PREROUTING -i $LAN_IFACE -d $IP_BANK -j ACCEPT


#
# 4.2.5 Цепочка POSTROUTING.
#

#
# Включаем простой IP форвардинг и преобразование сетевых адресов.
#

$IPTABLES -t nat -A POSTROUTING -o $INET_IFACE -j SNAT --to-source $INET_IP


 echo "1" > /proc/sys/net/ipv4/ip_forward

exit 0

вот такую ошибку выдает

iptables v1.3.6: host/network `ppp0' not found
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.6: host/network `ppp0' not found
Try `iptables -h' or 'iptables --help' for more information.
init.d/fir1.sh: 315: ▒echo: not found

Вот что прописано в interfaces



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig nas0 up # line maintained by pppoeconf
provider dsl-provider

auto nas0



iface nas0 inet manual
может кто нить конфиг выложит
« Последнее редактирование: 23 Мая 2008, 14:52:39 от SpNaz »

Оффлайн ais77

  • Автор темы
  • Участник
  • *
  • Сообщений: 186
  • linux blondy
    • Просмотр профиля
Для iptables сильно рекомендую вот этот известный конфигуратор
http://easyfwgen.morizot.net/gen/
у мну (и многих) работает исправно,чего и тебе желаю.

а почему у тебя eth0 - dchp?
в локалке адрес раздается кем-то - не тобой?

мои конфиг:
$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig nas0 up
provider dsl-provider

auto nas0
iface nas0 inet manual

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

iface bnep0 inet static
address 192.168.2.1
netmask 255.255.255.0
post-up iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -j MASQUERADE
post-up iptables -A FORWARD -i bnep0 -o eth0 -j ACCEPT
post-up iptables -A FORWARD -o bnep0 -i eth0 -j ACCEPT

bnep0 - не обращай внимания, это блютус-сетка, бьюсь пока с ноутом на хр
а сквид висит на статическом 192.168.0.1 eth0, раздавая нет на домашнюю мини-локалку с хр-машинами

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
Цитировать
а почему у тебя eth0 - dchp?
в локалке адрес раздается кем-то - не тобой?
да именно сервак 2000

спасибо что ответили будем пробовать :)

Оффлайн mindstorm

  • Новичок
  • *
  • Сообщений: 19
    • Просмотр профиля
OMNI zyxell ADLS usb EE + kubuntu 7.10
всё по инструкции

#pon dsl-provider
plugin rp-pppoe.so loaded

после чего пинга нет(network is unreachable), ppp0 нет(только eth0, lo, nas0),
в логах
Timeout waiting for PADO packets
Timeout waiting for PADO packets
Timeout waiting for PADO packets
Timeout waiting for PADO packets


искал решение проблемы во многих местах ничего путного так и не попалось, когдато давно было тоже самое с мандривой только ppp0 но тоже Timeout waiting for PADO packets, можно с этим чтото зделать????????????????????

PS нашёл что PADO фактически является первым ответом dsl-ac, ели его нет получается что нет и сети, значит ошибка в предидущих шагах?
« Последнее редактирование: 25 Мая 2008, 02:28:34 от mindstorm »

Оффлайн mindstorm

  • Новичок
  • *
  • Сообщений: 19
    • Просмотр профиля
есть у когонить идей по данному вопросу или тема так и уйдёт в архив?

Оффлайн ais77

  • Автор темы
  • Участник
  • *
  • Сообщений: 186
  • linux blondy
    • Просмотр профиля
ppp0 нет(только eth0, lo, nas0),
в логах
Timeout waiting for PADO packets
т.е. ppp0 не поднялся.
1) покажи interfaces и ifconfig
2)
modprobe br2684
br2684ctl -b -c 0 -a 0.1.50
что в логах выдают?
есть ощущение, что у тебя бридж не встает почему-то...
система, поди - многострадальная, много чего ставилось-сносилось?
гарантированно работает на свежей невинной ;) убе...

Оффлайн mindstorm

  • Новичок
  • *
  • Сообщений: 19
    • Просмотр профиля
возможно проблема и в бридже но явно об этом в логах ничего нет
vpi=8 vci=35
Encapsulation mode Bridget IP Over ATM LLCSNAP (RFC1483)

Система новая спецово была поставлена для проболжения настройки зиксела ))

итак приведу все логи последовательных издевательств над модемом :)
КОНСОЛЬ
mindstom@Zl0ba:~$ sudo modprobe br2684
[sudo] password for mindstom:
mindstom@Zl0ba:~$ sudo br2684ctl -b -c 0 -a 0.8.35
RFC1483/2684 bridge: Interface "nas0" created successfully
RFC1483/2684 bridge: Communicating over ATM 0.8.35, encapsulation: LLC
RFC1483/2684 bridge: Interface configured
mindstom@Zl0ba:~$ sudo ifconfig nas0
nas0      Link encap:Ethernet  HWaddr 00:13:49:35:CE:C8
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:100 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

mindstom@Zl0ba:~$ pon dsl-provider
Plugin rp-pppoe.so loaded.
mindstom@Zl0ba:~$ ping ya.ru
ping: unknown host ya.ru
mindstom@Zl0ba:~$ ping 89.20.128.56
connect: Network is unreachable
mindstom@Zl0ba:~$ modprobe br2684
mindstom@Zl0ba:~$ sudo modprobe br2684
mindstom@Zl0ba:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:CC:AC:29
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:20

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
mindstom@Zl0ba:~$ sudo ip l set nas0 up
mindstom@Zl0ba:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:CC:AC:29
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:20

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

nas0      Link encap:Ethernet  HWaddr 00:13:49:35:CE:C8
          inet6 addr: fe80::213:49ff:fe35:cec8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:415 errors:0 dropped:3109 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:134138 (130.9 KB)  TX bytes:528 (528.0 b)
mindstom@Zl0ba:~$ sudo ifconfig nas0 192.168.1.250 netmask 255.255.255.0 broadcast 192.168.1.255
mindstom@Zl0ba:~$ sudo route add default gw 192.168.1.1
mindstom@Zl0ba:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:CC:AC:29
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:20

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

nas0      Link encap:Ethernet  HWaddr 00:13:49:35:CE:C8
          inet addr:192.168.1.250  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::213:49ff:fe35:cec8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:642 errors:0 dropped:3109 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:189674 (185.2 KB)  TX bytes:3586 (3.5 KB)
var/log/message
Feb  7 00:40:13 Zl0ba kernel: [  343.600207] usb 2-1: new full speed USB device using uhci_hcd and address 2
Feb  7 00:40:13 Zl0ba kernel: [  343.768966] usb 2-1: configuration #1 chosen from 1 choice
Feb  7 00:40:15 Zl0ba kernel: [  345.846189] usbcore: registered new interface driver cxacru
Feb  7 00:40:16 Zl0ba kernel: [  346.008671] cxacru 2-1:1.0: found firmware cxacru-fw.bin
Feb  7 00:40:16 Zl0ba kernel: [  346.024869] cxacru 2-1:1.0: found firmware cxacru-cf.bin
Feb  7 00:40:22 Zl0ba kernel: [  352.637796] ATM dev 0: ADSL state: stopped
Feb  7 00:40:22 Zl0ba kernel: [  352.637803] ATM dev 0: ADSL line: down
Feb  7 00:40:23 Zl0ba kernel: [  353.737801] ATM dev 0: ADSL state: running
Feb  7 00:40:23 Zl0ba kernel: [  353.737808] ATM dev 0: ADSL line: initializing
Feb  7 00:40:24 Zl0ba kernel: [  354.726023] ATM dev 0: ADSL line: down
Feb  7 00:40:30 Zl0ba kernel: [  360.721146] ATM dev 0: ADSL line: attempting to activate
Feb  7 00:40:31 Zl0ba kernel: [  361.725324] ATM dev 0: ADSL line: down
Feb  7 00:40:33 Zl0ba kernel: [  363.717712] ATM dev 0: ADSL line: attempting to activate
Feb  7 00:40:37 Zl0ba kernel: [  367.704487] ATM dev 0: ADSL line: training
Feb  7 00:40:39 Zl0ba kernel: [  369.711849] ATM dev 0: ADSL line: channel analysis
Feb  7 00:40:43 Zl0ba kernel: [  373.691635] ATM dev 0: ADSL line: up (384 kb/s down | 128 kb/s up)
Feb  7 00:41:23 Zl0ba syslogd 1.4.1#21ubuntu3: restart.
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Interface "nas0" created successfully
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Communicating over ATM 0.8.35, encapsulation: LLC
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Interface configured
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: RFC 1483/2684 bridge daemon started
Feb  7 00:43:50 Zl0ba pppd[5305]: Plugin rp-pppoe.so loaded.
Feb  7 00:43:50 Zl0ba kernel: [  560.467478] PPP generic driver version 2.4.2
Feb  7 00:43:50 Zl0ba kernel: [  560.485292] NET: Registered protocol family 17
Feb  7 00:43:50 Zl0ba pppd[5318]: pppd 2.4.4 started by mindstom, uid 1000
Feb  7 00:43:50 Zl0ba pppd[5318]: Exit.
----------после ручного поднятия и конфигурирования nas0-------------
Feb  7 00:56:08 Zl0ba pppd[5469]: Plugin rp-pppoe.so loaded.
Feb  7 00:56:08 Zl0ba pppd[5471]: pppd 2.4.4 started by mindstom, uid 1000
Feb  7 00:56:55 Zl0ba pppd[5471]: Timeout waiting for PADO packets
Feb  7 00:58:00 Zl0ba pppd[5471]: Timeout waiting for PADO packets

пинг во внутренней сети может и проходят но убедится в этом неполучилось, сложно найти живой IP который бы пинговался
но вот пинг яндекса т.е. врмя от команды пинга до сообщения "нет такого хоста" проходит значительное похоже что во внутренней сети он всёже лазит и даже пытается найти на DNS-запись

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
после nas0 up настроил pppoeconf? и где interfaces?

а у тебя модем точно ZyXEL OMNI ADSL USB EE?

p.s. у меня ZyXEL OMNI ADSL USB EE? + Kubuntu 7.04(базовая установка) =О'К
да и когда модем настраивал в первый раз nas0 не поднимался прилось вручную как написано здесь поднимать и вуаля.
Замечу что с этим же модемом в Ubuntu 7.04(Desktop) nas0 автоматом поднимался
« Последнее редактирование: 27 Мая 2008, 06:34:55 от SpNaz »

Оффлайн mindstorm

  • Новичок
  • *
  • Сообщений: 19
    • Просмотр профиля
OMNI zyxell ADLS usb Annex A онже и EE, прошивку сделал из родных его драверов

pppoeconf нужно каждый раз выполнять? (я так понял что только 1 раз при первой настройке)
interfaces невыполняется никак вообще ни от пользователя ни от рута, пишет что нет такой команды

может ли влиять на подключение нестандартная/неполная настройки оборудования прова? (у них с этим большие пробьлемы, т.к. если чтото и настроено то все по дефолту )) )
« Последнее редактирование: 27 Мая 2008, 09:50:53 от mindstorm »

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
pppoeconf нужно каждый раз выполнять? (я так понял что только 1 раз при первой настройке) да 1 раз а если ошибся?
interfaces невыполняется никак вообще ни от пользователя ни от рута, пишет что нет такой команды это не команда
посмотри вот здесь /etc/network/interfaces

вообщем впервый раз я делал так:

modprobe br2684
br2684ctl -b -c 0 -a 0.1.50
pon dsl-provider
пинги не ходили, но после добавилвот это
ifconfig nas0 up
и все OK

p.s покажи interfaces

Оффлайн ais77

  • Автор темы
  • Участник
  • *
  • Сообщений: 186
  • linux blondy
    • Просмотр профиля
Странная история.

Итак, по пунктам:
1. Модем поднялся:
Feb  7 00:40:13 Zl0ba kernel: [  343.600207] usb 2-1: new full speed USB device using uhci_hcd and address 2
Feb  7 00:40:13 Zl0ba kernel: [  343.768966] usb 2-1: configuration #1 chosen from 1 choice
Feb  7 00:40:15 Zl0ba kernel: [  345.846189] usbcore: registered new interface driver cxacru
Feb  7 00:40:16 Zl0ba kernel: [  346.008671] cxacru 2-1:1.0: found firmware cxacru-fw.bin
Feb  7 00:40:16 Zl0ba kernel: [  346.024869] cxacru 2-1:1.0: found firmware cxacru-cf.bin

2. Бридж тоже:
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Interface "nas0" created successfully
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Communicating over ATM 0.8.35, encapsulation: LLC
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: Interface configured
Feb  7 00:43:26 Zl0ba RFC1483/2684 bridge: RFC 1483/2684 bridge daemon started

3. ppoeconf прошел удачно - т.к. соединение с провом есть:
Feb  7 00:40:22 Zl0ba kernel: [  352.637796] ATM dev 0: ADSL state: stopped
Feb  7 00:40:22 Zl0ba kernel: [  352.637803] ATM dev 0: ADSL line: down
Feb  7 00:40:23 Zl0ba kernel: [  353.737801] ATM dev 0: ADSL state: running
Feb  7 00:40:23 Zl0ba kernel: [  353.737808] ATM dev 0: ADSL line: initializing
Feb  7 00:40:24 Zl0ba kernel: [  354.726023] ATM dev 0: ADSL line: down
Feb  7 00:40:30 Zl0ba kernel: [  360.721146] ATM dev 0: ADSL line: attempting to activate
Feb  7 00:40:31 Zl0ba kernel: [  361.725324] ATM dev 0: ADSL line: down
Feb  7 00:40:33 Zl0ba kernel: [  363.717712] ATM dev 0: ADSL line: attempting to activate
Feb  7 00:40:37 Zl0ba kernel: [  367.704487] ATM dev 0: ADSL line: training
Feb  7 00:40:39 Zl0ba kernel: [  369.711849] ATM dev 0: ADSL line: channel analysis
Feb  7 00:40:43 Zl0ba kernel: [  373.691635] ATM dev 0: ADSL line: up (384 kb/s down | 128 kb/s up)
Feb  7 00:41:23 Zl0ba syslogd 1.4.1#21ubuntu3: restart.
Смущают две вещи:
а) несколько раз линия встает-падает в даун. Может объясняться спецификой прова - на стриме после первого поднятия - тренинг и коннект, даунов нет.
б) зачем ты рестарт-то системы сразу сделал?

т.е. имеем ситуевину:
1. модем поднялся и приконнектился, его интерфейс создан и работает
2. нет сетевого интерфейса ppp0 (видимо, как-то некорректно отработал pppoeconf - что-то ему помешало did his job)

Солюшен:
1. ручками прописать интерфейс dsl-provider в unterfaces
мой вариант:
~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig nas0 up
provider dsl-provider

auto nas0
iface nas0 inet manual

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

при этом в системе должно быть следующее
$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:07:E9:DA:47:C8
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::207:e9ff:feda:47c8/64 Диапазон:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:140648 errors:0 dropped:0 overruns:0 frame:0
          TX packets:188733 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:70990974 (67.7 MB)  TX bytes:186382464 (177.7 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Диапазон:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8240 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1148132 (1.0 MB)  TX bytes:1148132 (1.0 MB)

nas0      Link encap:Ethernet  HWaddr 00:13:49:1E:FF:FF
          inet6 addr: fe80::213:49ff:fe1e:ffff/64 Диапазон:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31973576 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38374067 errors:358379 dropped:0 overruns:358379 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:266728785 (254.3 MB)  TX bytes:2677660866 (2.4 GB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:91.76.89.136  P-t-P:91.76.88.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:79844 errors:0 dropped:0 overruns:0 frame:0
          TX packets:109251 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:5375036 (5.1 MB)  TX bytes:116197689 (110.8 MB)

2. Показать тут вывод команды route (дабы убедиться, что дефолт у нас на инетный интерфейс ведет)
у меня так:
$ route
Таблица маршутизации ядра протокола IP
Destination Gateway Genmask Flags Metric Ref Use Iface
ppp91-76-88-1.p *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1000   0        0 eth0
default         *               0.0.0.0         U     0      0        0 ppp0

Оффлайн SpNaz

  • Новичок
  • *
  • Сообщений: 31
    • Просмотр профиля
ais77 по твоему совету генерировал скрипт:
#!/bin/sh
#
# Generated iptables firewall script for the Linux 2.4 kernel
# Script generated by Easy Firewall Generator for IPTables 1.15
# copyright 2002 Timothy Scott Morizot
#
# Redhat chkconfig comments - firewall applied early,
#                             removed late
# chkconfig: 2345 08 92
# description: This script applies or removes iptables firewall rules
#
# This generator is primarily designed for RedHat installations,
# although it should be adaptable for others.
#
# It can be executed with the typical start and stop arguments.
# If used with stop, it will stop after flushing the firewall.
# The save and restore arguments will save or restore the rules
# from the /etc/sysconfig/iptables file.  The save and restore
# arguments are included to preserve compatibility with
# Redhat's or Fedora's init.d script if you prefer to use it.

# Redhat/Fedora installation instructions
#
# 1. Have the system link the iptables init.d startup script into run states
#    2, 3, and 5.
#    chkconfig --level 235 iptables on
#
# 2. Save this script and execute it to load the ruleset from this file.
#    You may need to run the dos2unix command on it to remove carraige returns.
#
# 3. To have it applied at startup, copy this script to
#    /etc/init.d/iptables.  It accepts stop, start, save, and restore
#    arguments.  (You may wish to save the existing one first.)
#    Alternatively, if you issue the 'service iptables save' command
#    the init.d script should save the rules and reload them at runtime.
#
# 4. For non-Redhat systems (or Redhat systems if you have a problem), you
#    may want to append the command to execute this script to rc.local.
#    rc.local is typically located in /etc and /etc/rc.d and is usually
#    the last thing executed on startup.  Simply add /path/to/script/script_name
#    on its own line in the rc.local file.

###############################################################################
#
# Local Settings
#

# sysctl location.  If set, it will use sysctl to adjust the kernel parameters.
# If this is set to the empty string (or is unset), the use of sysctl
# is disabled.

SYSCTL="/sbin/sysctl -w"

# To echo the value directly to the /proc file instead
# SYSCTL=""

# IPTables Location - adjust if needed

IPT="/sbin/iptables"
IPTS="/sbin/iptables-save"
IPTR="/sbin/iptables-restore"

# Internet Interface
INET_IFACE="ppp0"

# Local Interface Information
LOCAL_IFACE="eth0"
LOCAL_IP="10.10.1.28"
LOCAL_NET="10.10.1.0/16"
LOCAL_BCAST="10.10.1.255"

# Localhost Interface

LO_IFACE="lo"
LO_IP="127.0.0.1"

# Save and Restore arguments handled here
if [ "$1" = "save" ]
then
echo -n "Saving firewall to /etc/sysconfig/iptables ... "
$IPTS > /etc/sysconfig/iptables
echo "done"
exit 0
elif [ "$1" = "restore" ]
then
echo -n "Restoring firewall from /etc/sysconfig/iptables ... "
$IPTR < /etc/sysconfig/iptables
echo "done"
exit 0
fi

###############################################################################
#
# Load Modules
#

echo "Loading kernel modules ..."

# You should uncomment the line below and run it the first time just to
# ensure all kernel module dependencies are OK.  There is no need to run
# every time, however.

# /sbin/depmod -a

# Unless you have kernel module auto-loading disabled, you should not
# need to manually load each of these modules.  Other than ip_tables,
# ip_conntrack, and some of the optional modules, I've left these
# commented by default.  Uncomment if you have any problems or if
# you have disabled module autoload.  Note that some modules must
# be loaded by another kernel module.

# core netfilter module
/sbin/modprobe ip_tables

# the stateful connection tracking module
/sbin/modprobe ip_conntrack

# filter table module
# /sbin/modprobe iptable_filter

# mangle table module
# /sbin/modprobe iptable_mangle

# nat table module
# /sbin/modprobe iptable_nat

# LOG target module
# /sbin/modprobe ipt_LOG

# This is used to limit the number of packets per sec/min/hr
# /sbin/modprobe ipt_limit

# masquerade target module
# /sbin/modprobe ipt_MASQUERADE

# filter using owner as part of the match
# /sbin/modprobe ipt_owner

# REJECT target drops the packet and returns an ICMP response.
# The response is configurable.  By default, connection refused.
# /sbin/modprobe ipt_REJECT

# This target allows packets to be marked in the mangle table
# /sbin/modprobe ipt_mark

# This target affects the TCP MSS
# /sbin/modprobe ipt_tcpmss

# This match allows multiple ports instead of a single port or range
# /sbin/modprobe multiport

# This match checks against the TCP flags
# /sbin/modprobe ipt_state

# This match catches packets with invalid flags
# /sbin/modprobe ipt_unclean

# The ftp nat module is required for non-PASV ftp support
/sbin/modprobe ip_nat_ftp

# the module for full ftp connection tracking
/sbin/modprobe ip_conntrack_ftp

# the module for full irc connection tracking
/sbin/modprobe ip_conntrack_irc


###############################################################################
#
# Kernel Parameter Configuration
#
# See http://ipsysctl-tutorial.frozentux.net/chunkyhtml/index.html
# for a detailed tutorial on sysctl and the various settings
# available.

# Required to enable IPv4 forwarding.
# Redhat users can try setting FORWARD_IPV4 in /etc/sysconfig/network to true
# Alternatively, it can be set in /etc/sysctl.conf
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/ip_forward
else
    $SYSCTL net.ipv4.ip_forward="1"
fi

# This enables dynamic address hacking.
# This may help if you have a dynamic IP address \(e.g. slip, ppp, dhcp\).
#if [ "$SYSCTL" = "" ]
#then
#    echo "1" > /proc/sys/net/ipv4/ip_dynaddr
#else
#    $SYSCTL net.ipv4.ip_dynaddr="1"
#fi

# This enables SYN flood protection.
# The SYN cookies activation allows your system to accept an unlimited
# number of TCP connections while still trying to give reasonable
# service during a denial of service attack.
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/tcp_syncookies
else
    $SYSCTL net.ipv4.tcp_syncookies="1"
fi

# This enables source validation by reversed path according to RFC1812.
# In other words, did the response packet originate from the same interface
# through which the source packet was sent?  It's recommended for single-homed
# systems and routers on stub networks.  Since those are the configurations
# this firewall is designed to support, I turn it on by default.
# Turn it off if you use multiple NICs connected to the same network.
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
else
    $SYSCTL net.ipv4.conf.all.rp_filter="1"
fi

# This option allows a subnet to be firewalled with a single IP address.
# It's used to build a DMZ.  Since that's not a focus of this firewall
# script, it's not enabled by default, but is included for reference.
# See: http://www.sjdjweis.com/linux/proxyarp/
#if [ "$SYSCTL" = "" ]
#then
#    echo "1" > /proc/sys/net/ipv4/conf/all/proxy_arp
#else
#    $SYSCTL net.ipv4.conf.all.proxy_arp="1"
#fi

# The following kernel settings were suggested by Alex Weeks. Thanks!

# This kernel parameter instructs the kernel to ignore all ICMP
# echo requests sent to the broadcast address.  This prevents
# a number of smurfs and similar DoS nasty attacks.
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
else
    $SYSCTL net.ipv4.icmp_echo_ignore_broadcasts="1"
fi

# This option can be used to accept or refuse source routed
# packets.  It is usually on by default, but is generally
# considered a security risk.  This option turns it off.
if [ "$SYSCTL" = "" ]
then
    echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
else
    $SYSCTL net.ipv4.conf.all.accept_source_route="0"
fi

# This option can disable ICMP redirects.  ICMP redirects
# are generally considered a security risk and shouldn't be
# needed by most systems using this generator.
#if [ "$SYSCTL" = "" ]
#then
#    echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects
#else
#    $SYSCTL net.ipv4.conf.all.accept_redirects="0"
#fi

# However, we'll ensure the secure_redirects option is on instead.
# This option accepts only from gateways in the default gateways list.
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/conf/all/secure_redirects
else
    $SYSCTL net.ipv4.conf.all.secure_redirects="1"
fi

# This option logs packets from impossible addresses.
if [ "$SYSCTL" = "" ]
then
    echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
else
    $SYSCTL net.ipv4.conf.all.log_martians="1"
fi


###############################################################################
#
# Flush Any Existing Rules or Chains
#

echo "Flushing Tables ..."

# Reset Default Policies
$IPT -P INPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t mangle -P PREROUTING ACCEPT
$IPT -t mangle -P OUTPUT ACCEPT

# Flush all rules
$IPT -F
$IPT -t nat -F
$IPT -t mangle -F

# Erase all non-default chains
$IPT -X
$IPT -t nat -X
$IPT -t mangle -X

if [ "$1" = "stop" ]
then
echo "Firewall completely flushed!  Now running with no firewall."
exit 0
fi

###############################################################################
#
# Rules Configuration
#

###############################################################################
#
# Filter Table
#
###############################################################################

# Set Policies

$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP

###############################################################################
#
# User-Specified Chains
#
# Create user chains to reduce the number of rules each packet
# must traverse.

echo "Create and populate custom rule chains ..."

# Create a chain to filter INVALID packets

$IPT -N bad_packets

# Create another chain to filter bad tcp packets

$IPT -N bad_tcp_packets

# Create separate chains for icmp, tcp (incoming and outgoing),
# and incoming udp packets.

$IPT -N icmp_packets

# Used for UDP packets inbound from the Internet
$IPT -N udp_inbound

# Used to block outbound UDP services from internal network
# Default to allow all
$IPT -N udp_outbound

# Used to allow inbound services if desired
# Default fail except for established sessions
$IPT -N tcp_inbound

# Used to block outbound services from internal network
# Default to allow all
$IPT -N tcp_outbound

###############################################################################
#
# Populate User Chains
#

# bad_packets chain
#

# Drop packets received on the external interface
# claiming a source of the local network
$IPT -A bad_packets -p ALL -i $INET_IFACE -s $LOCAL_NET -j LOG \
    --log-prefix "Illegal source: "

$IPT -A bad_packets -p ALL -i $INET_IFACE -s $LOCAL_NET -j DROP

# Drop INVALID packets immediately
$IPT -A bad_packets -p ALL -m state --state INVALID -j LOG \
    --log-prefix "Invalid packet: "

$IPT -A bad_packets -p ALL -m state --state INVALID -j DROP

# Then check the tcp packets for additional problems
$IPT -A bad_packets -p tcp -j bad_tcp_packets

# All good, so return
$IPT -A bad_packets -p ALL -j RETURN

# bad_tcp_packets chain
#
# All tcp packets will traverse this chain.
# Every new connection attempt should begin with
# a syn packet.  If it doesn't, it is likely a
# port scan.  This drops packets in state
# NEW that are not flagged as syn packets.

# Return to the calling chain if the bad packets originate
# from the local interface. This maintains the approach
# throughout this firewall of a largely trusted internal
# network.
$IPT -A bad_tcp_packets -p tcp -i $LOCAL_IFACE -j RETURN

# However, I originally did apply this filter to the forward chain
# for packets originating from the internal network.  While I have
# not conclusively determined its effect, it appears to have the
# interesting side effect of blocking some of the ad systems.
# Apparently some ad systems have the browser initiate a NEW
# connection that is not flagged as a syn packet to retrieve
# the ad image.  If you wish to experiment further comment the
# rule above. If you try it, you may also wish to uncomment the
# rule below.  It will keep those packets from being logged.
# There are a lot of them.
# $IPT -A bad_tcp_packets -p tcp -i $LOCAL_IFACE ! --syn -m state \
#     --state NEW -j DROP

$IPT -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \
    --log-prefix "New not syn: "
$IPT -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j DROP

$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j LOG \
    --log-prefix "Stealth scan: "
$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP

# All good, so return
$IPT -A bad_tcp_packets -p tcp -j RETURN

# icmp_packets chain
#
# This chain is for inbound (from the Internet) icmp packets only.
# Type 8 (Echo Request) is not accepted by default
# Enable it if you want remote hosts to be able to reach you.
# 11 (Time Exceeded) is the only one accepted
# that would not already be covered by the established
# connection rule.  Applied to INPUT on the external interface.
#
# See: http://www.ee.siue.edu/~rwalden/networking/icmp.html
# for more info on ICMP types.
#
# Note that the stateful settings allow replies to ICMP packets.
# These rules allow new packets of the specified types.

# ICMP packets should fit in a Layer 2 frame, thus they should
# never be fragmented.  Fragmented ICMP packets are a typical sign
# of a denial of service attack.
$IPT -A icmp_packets --fragment -p ICMP -j LOG \
    --log-prefix "ICMP Fragment: "
$IPT -A icmp_packets --fragment -p ICMP -j DROP

# Echo - uncomment to allow your system to be pinged.
# Uncomment the LOG command if you also want to log PING attempts
#
# $IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j LOG \
#    --log-prefix "Ping detected: "
# $IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j ACCEPT

# By default, however, drop pings without logging. Blaster
# and other worms have infected systems blasting pings.
# Comment the line below if you want pings logged, but it
# will likely fill your logs.
$IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j DROP

# Time Exceeded
$IPT -A icmp_packets -p ICMP -s 0/0 --icmp-type 11 -j ACCEPT

# Not matched, so return so it will be logged
$IPT -A icmp_packets -p ICMP -j RETURN

# TCP & UDP
# Identify ports at:
#    http://www.chebucto.ns.ca/~rakerman/port-table.html
#    http://www.iana.org/assignments/port-numbers

# udp_inbound chain
#
# This chain describes the inbound UDP packets it will accept.
# It's applied to INPUT on the external or Internet interface.
# Note that the stateful settings allow replies.
# These rules are for new requests.
# It drops netbios packets (windows) immediately without logging.

# Drop netbios calls
# Please note that these rules do not really change the way the firewall
# treats netbios connections.  Connections from the localhost and
# internal interface (if one exists) are accepted by default.
# Responses from the Internet to requests initiated by or through
# the firewall are also accepted by default.  To get here, the
# packets would have to be part of a new request received by the
# Internet interface.  You would have to manually add rules to
# accept these.  I added these rules because some network connections,
# such as those via cable modems, tend to be filled with noise from
# unprotected Windows machines.  These rules drop those packets
# quickly and without logging them.  This prevents them from traversing
# the whole chain and keeps the log from getting cluttered with
# chatter from Windows systems.
$IPT -A udp_inbound -p UDP -s 0/0 --destination-port 137 -j DROP
$IPT -A udp_inbound -p UDP -s 0/0 --destination-port 138 -j DROP

# Dynamic Address
# If DHCP, the initial request is a broadcast. The response
# doesn't exactly match the outbound packet.  This explicitly
# allow the DHCP ports to alleviate this problem.
# If you receive your dynamic address by a different means, you
# can probably comment this line.
$IPT -A udp_inbound -p UDP -s 0/0 --source-port 67 --destination-port 68 \
     -j ACCEPT


# Not matched, so return for logging
$IPT -A udp_inbound -p UDP -j RETURN

# udp_outbound chain
#
# This chain is used with a private network to prevent forwarding for
# UDP requests on specific protocols.  Applied to the FORWARD rule from
# the internal network.  Ends with an ACCEPT


# No match, so ACCEPT
$IPT -A udp_outbound -p UDP -s 0/0 -j ACCEPT

# tcp_inbound chain
#
# This chain is used to allow inbound connections to the
# system/gateway.  Use with care.  It defaults to none.
# It's applied on INPUT from the external or Internet interface.


# Not matched, so return so it will be logged
$IPT -A tcp_inbound -p TCP -j RETURN

# tcp_outbound chain
#
# This chain is used with a private network to prevent forwarding for
# requests on specific protocols.  Applied to the FORWARD rule from
# the internal network.  Ends with an ACCEPT


# No match, so ACCEPT
$IPT -A tcp_outbound -p TCP -s 0/0 -j ACCEPT

###############################################################################
#
# INPUT Chain
#

echo "Process INPUT chain ..."

# Allow all on localhost interface
$IPT -A INPUT -p ALL -i $LO_IFACE -j ACCEPT

# Drop bad packets
$IPT -A INPUT -p ALL -j bad_packets

# DOCSIS compliant cable modems
# Some DOCSIS compliant cable modems send IGMP multicasts to find
# connected PCs.  The multicast packets have the destination address
# 224.0.0.1.  You can accept them.  If you choose to do so,
# Uncomment the rule to ACCEPT them and comment the rule to DROP
# them  The firewall will drop them here by default to avoid
# cluttering the log.  The firewall will drop all multicasts
# to the entire subnet (224.0.0.1) by default.  To only affect
# IGMP multicasts, change '-p ALL' to '-p 2'.  Of course,
# if they aren't accepted elsewhere, it will only ensure that
# multicasts on other protocols are logged.
# Drop them without logging.
$IPT -A INPUT -p ALL -d 224.0.0.1 -j DROP
# The rule to accept the packets.
# $IPT -A INPUT -p ALL -d 224.0.0.1 -j ACCEPT

# Rules for the private network (accessing gateway system itself)
$IPT -A INPUT -p ALL -i $LOCAL_IFACE -s $LOCAL_NET -j ACCEPT
$IPT -A INPUT -p ALL -i $LOCAL_IFACE -d $LOCAL_BCAST -j ACCEPT


# Inbound Internet Packet Rules

# Accept Established Connections
$IPT -A INPUT -p ALL -i $INET_IFACE -m state --state ESTABLISHED,RELATED \
     -j ACCEPT

# Route the rest to the appropriate user chain
$IPT -A INPUT -p TCP -i $INET_IFACE -j tcp_inbound
$IPT -A INPUT -p UDP -i $INET_IFACE -j udp_inbound
$IPT -A INPUT -p ICMP -i $INET_IFACE -j icmp_packets

# Drop without logging broadcasts that get this far.
# Cuts down on log clutter.
# Comment this line if testing new rules that impact
# broadcast protocols.
$IPT -A INPUT -m pkttype --pkt-type broadcast -j DROP

# Log packets that still don't match
$IPT -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
    --log-prefix "INPUT packet died: "

###############################################################################
#
# FORWARD Chain
#

echo "Process FORWARD chain ..."

# Used if forwarding for a private network

# Drop bad packets
$IPT -A FORWARD -p ALL -j bad_packets

# Accept TCP packets we want to forward from internal sources
$IPT -A FORWARD -p tcp -i $LOCAL_IFACE -j tcp_outbound

# Accept UDP packets we want to forward from internal sources
$IPT -A FORWARD -p udp -i $LOCAL_IFACE -j udp_outbound

# If not blocked, accept any other packets from the internal interface
$IPT -A FORWARD -p ALL -i $LOCAL_IFACE -j ACCEPT

# Deal with responses from the internet
$IPT -A FORWARD -i $INET_IFACE -m state --state ESTABLISHED,RELATED \
     -j ACCEPT

# Port Forwarding is enabled, so accept forwarded traffic
$IPT -A FORWARD -p tcp -i $INET_IFACE --destination-port 8110 \
     --destination 10.10.1.6 -j ACCEPT

# Log packets that still don't match
$IPT -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \
    --log-prefix "FORWARD packet died: "

###############################################################################
#
# OUTPUT Chain
#

echo "Process OUTPUT chain ..."

# Generally trust the firewall on output

# However, invalid icmp packets need to be dropped
# to prevent a possible exploit.
$IPT -A OUTPUT -m state -p icmp --state INVALID -j DROP

# Localhost
$IPT -A OUTPUT -p ALL -s $LO_IP -j ACCEPT
$IPT -A OUTPUT -p ALL -o $LO_IFACE -j ACCEPT

# To internal network
$IPT -A OUTPUT -p ALL -s $LOCAL_IP -j ACCEPT
$IPT -A OUTPUT -p ALL -o $LOCAL_IFACE -j ACCEPT

# To internet
$IPT -A OUTPUT -p ALL -o $INET_IFACE -j ACCEPT

# Log packets that still don't match
$IPT -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
    --log-prefix "OUTPUT packet died: "

###############################################################################
#
# nat table
#
###############################################################################

# The nat table is where network address translation occurs if there
# is a private network.  If the gateway is connected to the Internet
# with a static IP, snat is used.  If the gateway has a dynamic address,
# masquerade must be used instead.  There is more overhead associated
# with masquerade, so snat is better when it can be used.
# The nat table has a builtin chain, PREROUTING, for dnat and redirects.
# Another, POSTROUTING, handles snat and masquerade.

echo "Load rules for nat table ..."

###############################################################################
#
# PREROUTING chain
#

# Port Forwarding
#
# Port forwarding forwards all traffic on a port or ports from
# the firewall to a computer on the internal LAN.  This can
# be required to support special situations.  For instance,
# this is the only way to support file transfers with an ICQ
# client on an internal computer.  It's also required if an internal
# system hosts a service such as a web server.  However, it's also
# a dangerous option.  It allows Internet computers access to
# your internal network.  Use it carefully and only if you're
# certain you know what you're doing.

$IPT -t nat -A PREROUTING -p tcp -i $INET_IFACE --destination-port 110:213.180.204.37 \
     -j DNAT --to-destination 10.10.1.6:8110
$IPT -t nat -A PREROUTING -p tcp -i $INET_IFACE --destination-port 25:213.180.204.38 \
     -j DNAT --to-destination 10.10.1.6:8025

###############################################################################
#
# POSTROUTING chain
#

$IPT -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE

###############################################################################
#
# mangle table
#
###############################################################################

# The mangle table is used to alter packets.  It can alter or mangle them in
# several ways.  For the purposes of this generator, we only use its ability
# to alter the TTL in packets.  However, it can be used to set netfilter
# mark values on specific packets.  Those marks could then be used in another
# table like filter, to limit activities associated with a specific host, for
# instance.  The TOS target can be used to set the Type of Service field in
# the IP header.  Note that the TTL target might not be included in the
# distribution on your system.  If it is not and you require it, you will
# have to add it.  That may require that you build from source.

echo "Load rules for mangle table ..."


а вот чем ответил :
root@ubuntu:/etc/init.d# ./agen.sh
Loading kernel modules ...
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.log_martians = 1
Flushing Tables ...
Create and populate custom rule chains ...
Process INPUT chain ...
Process FORWARD chain ...
Process OUTPUT chain ...
Load rules for nat table ...
iptables v1.3.6: invalid port/service `213.180.204.37' specified
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.6: invalid port/service `213.180.204.38' specified
Try `iptables -h' or 'iptables --help' for more information.
Load rules for mangle table ...

что посоветуешь?

 

Страница сгенерирована за 0.026 секунд. Запросов: 21.