Zdravím. Mám konfiguraci firewallu viz níže. Mým cílem je omezit přístup na natované porty 1111, 2222 jen z vybraných IP adres. To jsem chtěl udělat přidáním pravidel do chainu input (např. pro port 1111 tcp dport { 1111 } sadrr w.x.y.z accept). Nicméně už při konfiguraci níže jsou oba porty dostupné. Měl jsem za to, že porty otevírám v chainu input. Ale patrně je to jinak. Může mi někdo prosím poradit, jak by to mělo tedy vypadat?
Děkuji.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
iif "lo" accept comment "Accept any localhost traffic"
ct state invalid drop comment "Drop invalid connections"
ct state established,related accept comment "Accept traffic originated from us"
icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-done, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept comment "Accept ICMPv6"
icmp type echo-request accept
ip protocol igmp accept comment "Accept IGMP"
tcp dport ssh ip saddr { ipaddr, ipaddr } accept comment "Accept SSH on port 22"
tcp dport { https, openvpn } accept comment "Accept HTTP, OPENVPN (ports 443, 1194)"
udp dport { domain, bootps } accept comment "Accept DNS"
tcp dport { domain, bootps } accept comment "Accept DNS"
}
chain forward {
type filter hook forward priority 0; policy accept;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
table ip nat {
chain postrouting {
type nat hook postrouting priority 100; policy accept;
ip saddr ipaddr oif "eth0" masquerade
}
chain prerouting {
type nat hook prerouting priority 100; policy accept;
iif "eth0" tcp dport 1111 dnat to ipaddr
iif "eth0" tcp dport 2222 dnat to ipaddr:http
}
}