Запретить локалку ...

Post new topic   Reply to topic    DD-WRT Forum Index -> Использование и установка DD-WRT
Goto page 1, 2  Next
Author Message
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Wed Sep 30, 2009 9:46    Post subject: Запретить локалку ... Reply with quote
Господа, не пинайте сильно ногами.
подскажите как реализовать
Есть интерфейс eth1 - Публичный WiFi, есть wl0.1 - внутренний.

Надо чтобы с eth1 нельзя было попасть на 192.168.1.0/24

Понимаю что надо что-то с iptables городить, но опыта практического не имею...

Поможите пожалуйста.
Sponsor
maxdukov
DD-WRT Novice


Joined: 17 Sep 2009
Posts: 26

PostPosted: Wed Sep 30, 2009 10:02    Post subject: Reply with quote
скорее уж разнести порты в разные VLAN.
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Wed Sep 30, 2009 10:25    Post subject: Reply with quote
Не, не получится надо именно блокировать попытки из публичной сети зайти на 192.168.1.0/24

Потому как WAN и LAN это одно и то же в этом случае. Вот и требуется SSID private - WAN+LAN
а SSID public - только WAN и дальше в инет.
maxdukov
DD-WRT Novice


Joined: 17 Sep 2009
Posts: 26

PostPosted: Wed Sep 30, 2009 14:08    Post subject: Reply with quote
iptables -t FORWARD -i eth1 -d 192.168.1.0/24 -j REJECT
как-то так....
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Thu Oct 01, 2009 3:00    Post subject: Reply with quote
не получается ... пропускает.
Добавил строчку в save to firewall
Перезапустил роутер - не помогло, как ходило на 192.168.1.х так и ходит.
maxdukov
DD-WRT Novice


Joined: 17 Sep 2009
Posts: 26

PostPosted: Thu Oct 01, 2009 5:11    Post subject: Reply with quote
эта... а на SSID public другой диапазон адресов?
ну и iptables -L - посмотреть правила.
может быть есть правило, разрешающее прохождение, которое стоит раньше в списке (срабатывает более ранее правило)
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Thu Oct 01, 2009 7:59    Post subject: Reply with quote
SSID 192.168.100.0/24

Code:

\u@\h:\w\$ iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       udp  --  anywhere             anywhere            udp dpt:route
DROP       udp  --  anywhere             anywhere            udp dpt:route
ACCEPT     udp  --  anywhere             anywhere            udp dpt:route
DROP       icmp --  anywhere             anywhere
DROP       igmp --  anywhere             anywhere
ACCEPT     0    --  anywhere             anywhere            state NEW
logaccept  0    --  anywhere             anywhere            state NEW
DROP       0    --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     gre  --  192.168.100.0/24     anywhere
ACCEPT     tcp  --  192.168.100.0/24     anywhere            tcp dpt:1723
ACCEPT     0    --  anywhere             anywhere
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
lan2wan    0    --  anywhere             anywhere
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
TRIGGER    0    --  anywhere             anywhere            TRIGGER type:in match:0 relate:0
trigger_out  0    --  anywhere             anywhere
ACCEPT     0    --  anywhere             anywhere            state NEW
DROP       0    --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain advgrp_1 (0 references)
target     prot opt source               destination

Chain advgrp_10 (0 references)
target     prot opt source               destination

Chain advgrp_2 (0 references)
target     prot opt source               destination

Chain advgrp_3 (0 references)
target     prot opt source               destination

Chain advgrp_4 (0 references)
target     prot opt source               destination

Chain advgrp_5 (0 references)
target     prot opt source               destination

Chain advgrp_6 (0 references)
target     prot opt source               destination

Chain advgrp_7 (0 references)
target     prot opt source               destination

Chain advgrp_8 (0 references)
target     prot opt source               destination

Chain advgrp_9 (0 references)
target     prot opt source               destination

Chain grp_1 (0 references)
target     prot opt source               destination

Chain grp_10 (0 references)
target     prot opt source               destination

Chain grp_2 (0 references)
target     prot opt source               destination

Chain grp_3 (0 references)
target     prot opt source               destination

Chain grp_4 (0 references)
target     prot opt source               destination

Chain grp_5 (0 references)
target     prot opt source               destination

Chain grp_6 (0 references)
target     prot opt source               destination

Chain grp_7 (0 references)
target     prot opt source               destination

Chain grp_8 (0 references)
target     prot opt source               destination

Chain grp_9 (0 references)
target     prot opt source               destination

Chain lan2wan (1 references)
target     prot opt source               destination

Chain logaccept (1 references)
target     prot opt source               destination
ACCEPT     0    --  anywhere             anywhere

Chain logdrop (0 references)
target     prot opt source               destination
DROP       0    --  anywhere             anywhere

Chain logreject (0 references)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere            tcp reject-with tcp-reset

Chain trigger_out (1 references)
target     prot opt source               destination
maxdukov
DD-WRT Novice


Joined: 17 Sep 2009
Posts: 26

PostPosted: Thu Oct 01, 2009 18:28    Post subject: Reply with quote
ну.
я например никакого запрещающего правила в цепочке FORWARD не наблюдаю.
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Fri Oct 02, 2009 2:34    Post subject: Reply with quote
Слушай, а куда тогда писать
iptables -t FORWARD -i eth1 -d 192.168.1.0/24 -j REJECT

??
vladiba1
DD-WRT Novice


Joined: 09 Nov 2008
Posts: 22

PostPosted: Fri Oct 02, 2009 21:16    Post subject: Reply with quote
А AP Isolation в Enable в веб интерфейсе выставить не пробовали?

Wireless->Basic Settings->Virtual Interfaces
avdlex
DD-WRT Novice


Joined: 30 Sep 2009
Posts: 6

PostPosted: Mon Oct 05, 2009 2:00    Post subject: Reply with quote
Так это не то совсем - это же изоляция беспроводных клиентов друг от друга.
livestud
DD-WRT Novice


Joined: 28 Apr 2010
Posts: 13

PostPosted: Wed Apr 28, 2010 4:15    Post subject: Reply with quote
vladiba1 wrote:
А AP Isolation в Enable в веб интерфейсе выставить не пробовали?

Wireless->Basic Settings->Virtual Interfaces


А можно по подробнее?
Надо для каждого создавать свою, или только одну и через нее все конектятся???
loginrl103
DD-WRT User


Joined: 06 Nov 2009
Posts: 389

PostPosted: Wed Apr 28, 2010 6:14    Post subject: Reply with quote
в правилах иптейблс прописано же
Code:
ACCEPT     0    --  anywhere             anywhere

правило с drop/reject добавлять надо в НАЧАЛО таблицы.

правило должно быть вида
Code:
iptables -I FORWARD 1 -i eth1 -p tcp -d 192.168.1.0/24 -j DROP
livestud
DD-WRT Novice


Joined: 28 Apr 2010
Posts: 13

PostPosted: Wed Apr 28, 2010 22:37    Post subject: Reply with quote
loginrl103 wrote:
в правилах иптейблс прописано же
Code:
ACCEPT     0    --  anywhere             anywhere

правило с drop/reject добавлять надо в НАЧАЛО таблицы.

правило должно быть вида
Code:
iptables -I FORWARD 1 -i eth1 -p tcp -d 192.168.1.0/24 -j DROP


А доступ у них к серверу будет (Микротик)?


Last edited by livestud on Tue May 11, 2010 18:35; edited 1 time in total
loginrl103
DD-WRT User


Joined: 06 Nov 2009
Posts: 389

PostPosted: Thu Apr 29, 2010 7:10    Post subject: Reply with quote
приведённое правило все пакеты с интерфейса eth1 в сеть 192.168.1.0/24 блокирует. если микротик находится в подсети 192.168.1.0/24 и надо разрешить пакеты с eth1 на микротик то
Code:

iptables -I FORWARD 1 -i eth1 -p tcp -d 192.168.1.0/24 -j DROP
iptables -I FORWARD 1 -i eth1 -p tcp -d ip_microtik -j ACCEPT

тогда микротик будет доступен, остальная подсеть 192.168.1.0/24 - нет.

но твоя схема точно правильно нарисована?
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Использование и установка DD-WRT All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum