Zrestartowałem router i wpisałem od nowa:
iptables -I FORWARD -p tcp --dport 8200 ! -s 192.168.4.27 -d 192.168.4.40 -j REJECT
iptables -I FORWARD -p udp --dport 1900 ! -s 192.168.4.27 -d 192.168.4.40 -j REJECT
Niestety dalej działa dostęp z laptopa. Laptop ma adres:
192.168.4.51
Np. jak na laptopie wpiszę w przeglądarkę adres:
http://192.168.4.40:8200/
To pojawia mi się w html tabela podłączonych urządzeń. Moim zdaniem ta strona nie powinna się wczytywać z laptopa bo pochodzi z portu 8200 TCP.
Tymczasem pojawia się tabela jak niżej i jest w niej m.in. laptop z adresu ....51, na którym odtwarzam z miniDLNA (co chciałem zablokować):
http://192.168.4.40:8200/ - wyświetla się w przeglądarce www strona:
Media library
Audio files 0
Video files 658
Image files 0
Connected clients
ID Type IP Address HW Address Connections
0 Sony Bravia 192.168.4.17 54:53:ED:69:A3:D8 0
1 Generic DLNA 1.5 192.168.4.51 D8:FC:93:AA:1D:D8 1
2 Generic UPnP 1.0 192.168.4.50 EC:F4:BB:2F:62:2F 0
3 Generic UPnP 1.0 192.168.4.41 B0:05:94:FC:F0:23 0
4 BubbleUPnP 192.168.4.26 84:38:38:BD:FB:A4 0
5 Generic DLNA 1.5 192.168.4.81 70:4D:7B:52:BB:EE 0
6 Generic DLNA 1.5 192.168.4.31 98:E7:F5:3C:81:C6 0
7 Generic UPnP 1.0 192.168.4.53 AC:C1:EE:31:61:87 0
8 BubbleUPnP 192.168.4.27 A8:0C:63:5A:67:94 0
Laptop o adresie .51 zrestartowany, podłączony przez WiFi do routera.
-
na routerze: ( pojawia się niżej "HUAWEI_MATE_9.lan". Jest to telefon z którego jedynie ma być dostęp.
root@LEDE:~# ping HUAWEI_MATE_9.lan
PING HUAWEI_MATE_9.lan (192.168.4.27): 56 data bytes
64 bytes from 192.168.4.27: seq=0 ttl=64 time=310.809 ms
)
root@LEDE:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere /* !fw3 */
input_rule all -- anywhere anywhere /* !fw3: user chain for input */
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED /* !fw3 */
syn_flood tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN /* !fw3 */
zone_lan_input all -- anywhere anywhere /* !fw3 */
zone_wan_input all -- anywhere anywhere /* !fw3 */
Chain FORWARD (policy DROP)
target prot opt source destination
REJECT udp -- !HUAWEI_MATE_9.lan 192.168.4.40 udp dpt:1900 reject-with icmp-port-unreachable
REJECT tcp -- !HUAWEI_MATE_9.lan 192.168.4.40 tcp dpt:8200 reject-with icmp-port-unreachable
forwarding_rule all -- anywhere anywhere /* !fw3: user chain for forwarding */
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED /* !fw3 */
zone_lan_forward all -- anywhere anywhere /* !fw3 */
zone_wan_forward all -- anywhere anywhere /* !fw3 */
reject all -- anywhere anywhere /* !fw3 */
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere /* !fw3 */
output_rule all -- anywhere anywhere /* !fw3: user chain for output */
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED /* !fw3 */
zone_lan_output all -- anywhere anywhere /* !fw3 */
zone_wan_output all -- anywhere anywhere /* !fw3 */
Chain forwarding_lan_rule (1 references)
target prot opt source destination
Chain forwarding_rule (1 references)
target prot opt source destination
Chain forwarding_wan_rule (1 references)
target prot opt source destination
Chain input_lan_rule (1 references)
target prot opt source destination
Chain input_rule (1 references)
target prot opt source destination
Chain input_wan_rule (1 references)
target prot opt source destination
Chain output_lan_rule (1 references)
target prot opt source destination
Chain output_rule (1 references)
target prot opt source destination
Chain output_wan_rule (1 references)
target prot opt source destination
Chain reject (3 references)
target prot opt source destination
REJECT tcp -- anywhere anywhere /* !fw3 */ reject-with tcp-reset
REJECT all -- anywhere anywhere /* !fw3 */ reject-with icmp-port-unreachable
Chain syn_flood (1 references)
target prot opt source destination
RETURN tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50 /* !fw3 */
DROP all -- anywhere anywhere /* !fw3 */
Chain zone_lan_dest_ACCEPT (4 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_lan_forward (1 references)
target prot opt source destination
forwarding_lan_rule all -- anywhere anywhere /* !fw3: user chain for forwarding */
zone_wan_dest_ACCEPT all -- anywhere anywhere /* !fw3: forwarding lan -> wan */
ACCEPT all -- anywhere anywhere ctstate DNAT /* !fw3: Accept port forwards */
zone_lan_dest_ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_lan_input (1 references)
target prot opt source destination
input_lan_rule all -- anywhere anywhere /* !fw3: user chain for input */
ACCEPT all -- anywhere anywhere ctstate DNAT /* !fw3: Accept port redirections */
zone_lan_src_ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_lan_output (1 references)
target prot opt source destination
output_lan_rule all -- anywhere anywhere /* !fw3: user chain for output */
zone_lan_dest_ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_lan_src_ACCEPT (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere ctstate NEW,UNTRACKED /* !fw3 */
Chain zone_wan_dest_ACCEPT (2 references)
target prot opt source destination
DROP all -- anywhere anywhere ctstate INVALID /* !fw3: Prevent NAT leakage */
ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_wan_dest_REJECT (1 references)
target prot opt source destination
reject all -- anywhere anywhere /* !fw3 */
Chain zone_wan_forward (1 references)
target prot opt source destination
forwarding_wan_rule all -- anywhere anywhere /* !fw3: user chain for forwarding */
zone_lan_dest_ACCEPT esp -- anywhere anywhere /* !fw3: @rule[7] */
zone_lan_dest_ACCEPT udp -- anywhere anywhere udp dpt:isakmp /* !fw3: @rule[8] */
ACCEPT all -- anywhere anywhere ctstate DNAT /* !fw3: Accept port forwards */
zone_wan_dest_REJECT all -- anywhere anywhere /* !fw3 */
Chain zone_wan_input (1 references)
target prot opt source destination
input_wan_rule all -- anywhere anywhere /* !fw3: user chain for input */
ACCEPT udp -- anywhere anywhere udp dpt:bootpc /* !fw3: Allow-DHCP-Renew */
ACCEPT icmp -- anywhere anywhere icmp echo-request /* !fw3: Allow-Ping */
ACCEPT igmp -- anywhere anywhere /* !fw3: Allow-IGMP */
ACCEPT all -- anywhere anywhere ctstate DNAT /* !fw3: Accept port redirections */
zone_wan_src_REJECT all -- anywhere anywhere /* !fw3 */
Chain zone_wan_output (1 references)
target prot opt source destination
output_wan_rule all -- anywhere anywhere /* !fw3: user chain for output */
zone_wan_dest_ACCEPT all -- anywhere anywhere /* !fw3 */
Chain zone_wan_src_REJECT (1 references)
target prot opt source destination
reject all -- anywhere anywhere /* !fw3 */
root@LEDE:~#
WRT1900ACS, WNDR3700v2