iptables - 해시 제한 규칙이 입력된 경우 종속 포털(nodogsplash) 작동이 중지됨(OpenWRT)

iptables - 해시 제한 규칙이 입력된 경우 종속 포털(nodogsplash) 작동이 중지됨(OpenWRT)

openwrt를 사용하여 핫스팟 장치를 설정했습니다. 핫스팟 기능을 위해 nodogsplash가 설치되어 있고 대역폭 제한을 위해 iptables가 설치되어 있습니다. 속도 제한 스크립트를 테스트할 때 테스트 목적으로 핫스팟이 비활성화되었으므로 그 당시에는 충돌을 눈치채지 못했습니다. 문제는 iptables를 사용하는 내 스크립트와 nodogsplash가 트래픽 제어를 위해 iptables에서 "MARK"를 사용하고 여기서 충돌이 시작된다는 것입니다. 두 프로그램 모두 "0xa"와 같은 지정된 문자열로 트래픽을 표시하기 때문입니다. 이 문제를 해결하는 방법이나 IP당 대역폭을 제어할 수 있는 다른 방법이 있습니까?

iptables -t nat -A prerouting_rule -m mac --mac-source 1c:91:48:xx:xx:xx -j MARK --set-mark 0x0A -m comment --comment "PC"
iptables -t nat -A prerouting_rule -m mark --mark 0xA -j CONNMARK --save-mark
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables  -A forwarding_rule -m mark --mark 0xA -m conntrack --ctstate ESTABLISHED,RELATED -m hashlimit --hashlimit-name "Limit" --hashlimit-above 24kb/s -j DROP

이는 iptables 규칙을 생성하는 스크립트의 일부입니다.

nodogsplsh가 생성한 iptable 규칙 중 일부는 다음과 같습니다.

DROP       all  --  anywhere             anywhere             mark match 0x10000/0x30000
ndsAUT     all  --  anywhere             anywhere             mark match 0x30000/0x30000
ACCEPT     all  --  anywhere             anywhere             mark match 0x20000/0x30000

과하지 않고 충분한 정보를 제공하려고 노력하고 있습니다 :) 충분하길 바랍니다.

답변1

누군가 해결책이 필요하다면;

iptables -A forwarding_rule -d 192.168.1.10 -m hashlimit --hashlimit-name "speedLimit" --hashlimit-above 100kb/s -j DROP

옵션:

  • -디:클라이언트의 i주소

  • --hashlimit-이름:댓글 같은 이름

  • --hashlimit-위:속도 제한 값(kb/s)

관련 정보