Jednak wpis sie dodaje ale nie działa

hehhe smile , doszedłem do tego że jak wrzucę linię do, /tmp/userconfig/etc/rc.local. To plik __test się tworzy ale rula się nie dodaje

sleep 30
touch /tmp/__test
iptables -I INPUT -p tcp --dport 80 -s 192.168.10.0/24 -j DROP

już miałem taką regułkę tylko bez reload, jak robie restart to leci sporo błędów

root@ER8411:/etc/init.d# /etc/init.d/firewall restart
uci: Entry not found
iptables v1.6.2: Couldn't load target `zone_wan_openvpn':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables: Chain already exists.
iptables: Chain already exists.
iptables: Chain already exists.
uci: Entry not found
uci: Entry not found
rmc restart
ip6tables v1.6.2: The protocol family of set VMe is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables v1.6.2: The protocol family of set VMe is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables v1.6.2: The protocol family of set Me is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables v1.6.2: The protocol family of set VMe is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables v1.6.2: The protocol family of set Me is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables v1.6.2: The protocol family of set VMe is IPv4, which is not applicable.

Try `ip6tables -h' or 'ip6tables --help' for more information.

dodałem wpis zrobiłem /etc/init.d/firewall reload, nie działa sad

thx, jutro będę testował. tak btw to sam sie zdziwiłem ze pod spodem jest OpenWRT na czystym TP-linku.

Czy poniższa reguła w  config/firewall jest równoznaczna z iptables -I INPUT -p tcp --dport 80 -s 192.168.10.0/24 -j DROP ?

config rule
    option src_ip    '192.168.10.0/24'            
    option dest_port    '80'        
    option proto    tcp
    option target       REJECT

wrzuciłem mu do /tmp/userconfig/etc/firewall.user po restarcie jest w pliku /etc/firewall.user, ale reguła nie działa, jak z palca ją wklepię to działa sad

Tak to jest TP-Link, Interfejs ACL ma bardzo ograniczony, nie da się tego wyklinać

/dev/root on /rom type squashfs (ro,relatime)
devtmpfs on /rom/dev type devtmpfs (rw,relatime,size=1950640k,nr_inodes=487660,mode=755)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
root on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/root,workdir=/tmp/root/work)
/dev/mtdblock13 on /tmp/userconfig type jffs2 (rw,sync,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
nodev on /mnt/huge type hugetlbfs (rw,relatime,pagesize=2M)
tmpfs on /tmp/run/netns type tmpfs (rw,nosuid,nodev,noatime)
nsfs on /tmp/run/netns/vnet type nsfs (rw)

Po restarcie sprzętu zawartość z pliku znika

jak wrzucę regułki do /etc/firewall.user to po restarcie plik jest pusty a regułki nie działają. czy /etc/rc.local jest odpowiednim miejscem ?

Nie odcięło mi SSH tylko web service, sprawdzam to po pulpicie zdalnym z tej maszyny.
ta reguła działa
iptables -I INPUT -p tcp --dport 80 -s 192.168.10.0/24 -j DROP

thx za pomoc Cezary

jasne, przynajmniej wiadomo że działa

jak wbiłem regułę iptables -I INPUT -p tcp --dport 80 -j DROP to mnie odcięło, musiałem go zrestartować. smile
Tak dobijam się z tej sieci

to samo, curl 192.168.10.1 z maszyny zwraca strone

Witam

Posiadam router ER8411. Skonfigurowany jest w ten sposób że posiada vlan 10 z podsiecią 192.168.10.0/24. Serwer www routera dostępny jest pod adresem 192.168.10.1. Chciałbym zablokować te porty 80,443,22 żeby żądane urządzenie nie mogło się do niego dobijać z tej sieci. Niestety GUI ACL nie posiada takich opcji. Zalogowałem się na router dodałem następujące dwa wpisy do /etc/firewall.user

iptables -A INPUT -s 192.168.10.0/24 -d 192.168.10.1 -j DROP
iptables -A FORWARD -s 192.168.10.0/24 -d 192.168.10.1 -j DROP

i wykonałem reload firewalla
/etc/init.d/firewall reload

Jednak nie działa to w ogóle.
Ktoś mógłby mi pomóc ?

pytanie czy ta * powinna być na list ports 'wan:t*' czy list ports 'wan:u*' ?

udało się, na tej konfiguracji

config interface 'loopback'
    option device 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option packet_steering '1'
    option ula_prefix 'fd54:6fba:1478::/48'

config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'lan1'
    list ports 'lan2'

config interface 'lan'
    option device 'br-lan'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'lan2'
    option proto 'none'
    option device 'br-wan.6'

config interface 'wan'
    option proto 'pppoe'
    option username 'xxxx'
    option password 'xxxx'
    option ipv6 'auto'
    option device 'br-wan.2'

config device
    option type 'bridge'
    option name 'br-wan'
    list ports 'lan3'
    list ports 'lan4'
    list ports 'wan'

config bridge-vlan
    option device 'br-wan'
    option vlan '6'
    list ports 'wan:t'
    list ports 'lan3'
    list ports 'lan4'

config bridge-vlan
    option device 'br-wan'
    option vlan '2'
    list ports 'wan:u*'

ehh, chyba nie za bardzo to czaję

jak ustawie taki config to urządzenie się od razu restartuje po uruchomieniu (taki bootloop XD)

config device
    option type 'bridge'
    option name 'br-lan2'
    list ports 'wan.6'
    list ports 'lan3'
    list ports 'lan4'

config bridge-vlan
    option device 'br-lan2'
    option vlan '6'
    list ports 'wan:t'
    list ports 'lan3'
    list ports 'lan4'

jak ustawie samo bridge-vlan to nie działa

config bridge-vlan
    option device 'br-lan2'
    option vlan '6'
    list ports 'wan:t'
    list ports 'lan3'
    list ports 'lan4'

Skoro sekcja config bridge-vlan pomogła to rozumiem że musi być ustawiona, teraz tylko nie wiem jak ten port WAN wyłączyć z config device  żeby działał prawidłowo.

zrobiłem taką konfigurację

config device
    option type 'bridge'
    option name 'br-lan2'
    list ports 'wan'
    list ports 'lan3'
    list ports 'lan4'

config bridge-vlan
    option device 'br-lan2'
    option vlan '6'
    list ports 'wan:t'
    list ports 'lan3'
    list ports 'lan4'

naprawiłem sieć lan2 ale teraz nie działą mi WAN
dostaję Błąd: Próba połączenia nieudana na PPPoE

na portach lan4 lan3 nie mam w ogóle komunikacji z wan.6, poza pakietami ARP które dochodzą.

Działa tylko komunikacja z interfejsu lan2 do wan.6

cały czas pisze o interfejsie lan2 nie o porcie smile
fizyczny port lan2 jest w sieci lan z adresacją 192.168.1.1, i to działa prawidłowo.

lan2 ustawiłem niezrządzany bo nie chciałem żeby był widziany jako osobne urządzanie.

config device
    option type 'bridge'
    option name 'br-lan2'
    list ports 'wan.6'
    list ports 'lan3'
    list ports 'lan4'

Na portach lan nie działa komunikacja z siecią wan.6 nawet jak ustawie statycznie adres IP.
Na interfejsie lan2 jak ustawiam statyczny adres to komunikacja działa z siecią wan.6.

Próbowałem już rożnach sztuczek z zapora sieciową ale cały czas to samo

serwer dhcp jest w sieci wan.6

Dodam że jak ustawię adres na interfejsie lan2 to z niego wszystko działa, problem jest jak podłączę urządzenie do portu np:lan4 które jest w bridgu.