iptables 시간 규칙이 우분투 20.04에서 작동하지 않습니다

iptables 시간 규칙이 우분투 20.04에서 작동하지 않습니다

내 규칙은 다음과 같습니다.

iptables -A INPUT -m mac --mac-source 40:e2:30:f4:00:04 -m time --timestart 18:00:00 --timestop 23:59:59 --weekdays Mon,Tue,Wed,Thu,Fri -j ACCEPT
iptables -A INPUT -m mac --mac-source 40:e2:30:f4:00:04 -j DROP

20.04(iptables v1.8.4)에서는 작동하지 않습니다. 도움이 필요하세요?

PD:여기저자는 iptables가 시스템 시간이 아닌 UTC를 읽기 때문이라고 말합니다. 규칙을 시도해 보았지만 역시 작동하지 않습니다.

iptables -A INPUT -m mac --mac-source 40:e2:30:f4:00:04 --match time --weekdays Mon,Tue,Wed,Thu,Fri --timestart $(date -u -d @$(date "+%s" -d "18:00") +%H:%M) --timestop $(date -u -d @$(date "+%s" -d "23:00") +%H:%M) -j ACCEPT
iptables -A INPUT -m mac --mac-source 40:e2:30:f4:00:04 -j DROP

PD: 나는 --kerneltz(여기설명) 매개변수에는 UTC가 아닌 커널 시간대를 사용한다고 하는데 둘 다 아니다(그리고--kerneltz 매우 낙담함)

내 컴퓨터 시간:

timedatectl status
               Local time: sáb 2021-08-28 12:42:49 -05
           Universal time: sáb 2021-08-28 17:42:49 UTC
                 RTC time: sáb 2021-08-28 17:42:48    
                Time zone: America/Bogota (-05, -0500)
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no

date --utc 
sáb 28 ago 2021 17:44:23 UTC

다른 응용 프로그램에 영향을 미칠 수 있으므로 내 컴퓨터에 UTC 시간을 설정하지 않는 것이 해결책이라면 감사하겠습니다.

다른 규칙은 작동하지 않습니다(maclist.txt 콘텐츠 40:e2:30:f4:00:04 등).

current_time=$(date +%H) # actual 13
allowed_time=08
denied_time=12
maclist=$(awk '{print $1}' maclist.txt)
if [ \( $current_time -ge $allowed_time -a $current_time -lt $denied_time \) ]; then
    for mac in $(echo -e "$maclist"); do
        iptables -I INPUT -m mac --mac-source $mac -j NFLOG --nflog-prefix 'macblock'
        iptables -I INPUT -m mac --mac-source $mac -j ACCEPT
        iptables -I FORWARD -m mac --mac-source $mac -j NFLOG --nflog-prefix 'macblock'
        iptables -I FORWARD -m mac --mac-source $mac -j ACCEPT
    done
fi

나가sudo iptables -nvL

    0     0 NFLOG      tcp  --  eno2   *       0.0.0.0/0            0.0.0.0/0            MAC 40:e2:30:f4:00:04 TIME from 08:00:00 to 17:59:59 UTC nflog-prefix  blockports
    0     0 DROP       tcp  --  eno2   *       0.0.0.0/0            0.0.0.0/0            MAC 40:e2:30:f4:00:04 TIME from 08:00:00 to 17:59:59 UTC
    0     0 ACCEPT     tcp  --  eno2   *       0.0.0.0/0            0.0.0.0/0            MAC 40:e2:30:f4:00:04
          

관련 정보