#!/bin/sh # network : ipv6/mask || dns6/mask local network="${net6}" #netbios-ns 137/tcp # NETBIOS Name Service #netbios-ns 137/udp #netbios-dgm 138/tcp # NETBIOS Datagram Service #netbios-dgm 138/udp local netbiosnsPort="$( iptoolsServicesGetPort udp netbios-ns )" local netbiosdgmPort="$( iptoolsServicesGetPort udp netbios-dgm )" local ruleIn="$ruleIn ;smb_clt | -s "${net6}" -d "${broadcast6}" -p udp --sport ${netbiosnsPort} --dport ${netbiosnsPort} -m state --state NEW,ESTABLISHED,RELATED" local ruleIn="$ruleIn ;smb_clt | -s "${net6}" -d "${broadcast6}" -p udp --sport ${netbiosdgmPort} --dport ${netbiosdgmPort} -m state --state NEW,ESTABLISHED,RELATED" # clients : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # servers : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # forward : PROTO ; PORT | # -- CLIENT -- # SAMBA local clients="$clients|TCP ;microsoft-ds ;root/root" local clients="$clients|UDP ;netbios-ns ;root/root" local clients="$clients|UDP ;netbios-dgm ;root/root" # -- SERVER -- # ruleOut : iptables -t filter -A OUTPUT -o ""$eth"" -j ""$rulesOut"" # ruleIn : iptables -t filter -A INPUT -i ""$eth"" -j ""$rulesIn"" # dropOut : iptables -t filter -A OUTPUT -o ""$eth"" -j ""$rulesOut"" # dropIn : iptables -t filter -A INPUT -i ""$eth"" -j ""$rulesIn"" # NETFILTER_INPUTIN=enp9s0 OUT= MAC= SRC=10.90.6.107 DST=10.90.6.255 LEN=247 TOS=0x00 PREC=0x00 TTL=64 ID=8934 DF PROTO=UDP SPT=138 DPT=138 LEN=227 MARK=0x12 # clients : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # servers : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # forward : PROTO ; PORT |