LINUX.ORG.RU
ФорумAdmin

[OpenWrt][firewall] Подскажите конфиг

 ,


0

0

В общем есть роутер с OpenWrt на борту, раздаёт интернет на два ноута и на домашнюю файлопомойку/торрентокачалку. И есть белый IP, привязанный к no-ip. На файлопомойке поднят вебсервер для мелких нужд. В /etc/config/firewall указал

config 'redirect' 'www'
        option 'src' 'wan'
        option 'proto' 'tcp'
        option 'src_ip' ''
        option 'src_dport' '80'
        option 'dest_ip' '192.168.1.3'
        option 'dest_port' '8080'

config 'rule'
        option 'src' 'wan'
        option 'proto' 'tcp'
        option 'src_ip' ''
        option 'dest_ip' ''
        option 'dest_port' '80'
        option 'target' 'ACCEPT'

суть проблемы в том что из внешних интернетов всё работает как нужно, но с домашних ноутов меня туда не пускает :(

Ответ на: комментарий от anton_jugatsu
Chain INPUT (policy ACCEPT 11 packets, 704 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    1   123 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
  984  119K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
 9277  460K syn_flood  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 
24330 1508K input_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
24330 1508K input      all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
36869   18M zone_wan_MSSFIX  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
35115   18M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
 1754  149K forwarding_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 1754  149K forward    all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 reject     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
16386 1610K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
    0     0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0           
  385 25498 output_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  385 25498 output     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 1754  149K zone_lan_forward  all  --  br-lan *       0.0.0.0/0            0.0.0.0/0           
    0     0 zone_wan_forward  all  --  eth0.1 *       0.0.0.0/0            0.0.0.0/0           

Chain forwarding_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  970 74034 zone_lan   all  --  br-lan *       0.0.0.0/0            0.0.0.0/0           
23350 1434K zone_wan   all  --  eth0.1 *       0.0.0.0/0            0.0.0.0/0           

Chain input_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain output (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  385 25498 zone_lan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  381 24445 zone_wan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain reject (5 references)
 pkts bytes target     prot opt in     out     source               destination         
 9242  458K REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset 
14107  976K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable 

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 9277  460K RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 limit: avg 25/sec burst 50 
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           
vene4ka
() автор топика
Ответ на: комментарий от anton_jugatsu
Chain zone_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  970 74034 input_lan  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  970 74034 zone_lan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain zone_lan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
  970 74034 ACCEPT     all  --  br-lan *       0.0.0.0/0            0.0.0.0/0           
    4  1053 ACCEPT     all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0           

Chain zone_lan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  br-lan *       0.0.0.0/0            0.0.0.0/0           
    0     0 DROP       all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0           

Chain zone_lan_MSSFIX (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  *      br-lan  0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU 

Chain zone_lan_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all  --  br-lan *       0.0.0.0/0            0.0.0.0/0           
    0     0 reject     all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0           

Chain zone_lan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 1754  149K zone_wan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 forwarding_lan  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 zone_lan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain zone_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:68 
23350 1434K input_wan  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
23350 1434K zone_wan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  eth0.1 *       0.0.0.0/0            0.0.0.0/0           
 2135  174K ACCEPT     all  --  *      eth0.1  0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  eth0.1 *       0.0.0.0/0            0.0.0.0/0           
    0     0 DROP       all  --  *      eth0.1  0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_MSSFIX (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  731 43760 TCPMSS     tcp  --  *      eth0.1  0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU 

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
23349 1434K reject     all  --  eth0.1 *       0.0.0.0/0            0.0.0.0/0           
    0     0 reject     all  --  *      eth0.1  0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:8080 
    0     0 forwarding_wan  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 zone_wan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0   
vene4ka
() автор топика

Так в чём проблема, не веб-сервер из локалки не пускает?

anton_jugatsu ★★★★
()
Ответ на: комментарий от anton_jugatsu

так не работает :( работает как в мане написано:

iptables -t nat -A prerouting_rule -d 100.100.100.100 -p tcp --dport 80 -j DNAT --to 192.168.0.2
iptables -A forwarding_rule -p tcp --dport 80 -d 192.168.0.2 -j ACCEPT
iptables -t nat -A postrouting_rule -s 192.168.0.0/24 -p tcp --dport 80 -d 192.168.0.2 -j MASQUERADE
но...после рестарта фаервола все настройки эти убиваются, нужно их как-то в конфиг засунуть

vene4ka
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.