I'm trying to use iptables with modbus as a firewall. Is it possible to implement the two rules below as one line of rule?
sudo iptables -A INPUT -p tcp --dport 4031 -m u32 ! --u32 "0>>22&0x3c @12>>26&0x3c @0>>24&0xff=0x11" -j REJECT
sudo iptables -A INPUT -p tcp --dport 4031 -m u32 ! --u32 "0>>22&0x3c @12>>26&0x3c @0&0xffff=0x0088,0x0089,0x008A" -j REJECT
iptables seems to accept the rule below but I am unsure if it works properly like an AND function as expected.
sudo iptables -A INPUT -p tcp --dport 4031 -m u32 ! --u32 "0>>22&0x3c @12>>26&0x3c @0>>24&0xff=0x11 && 0&0xffff=0x0088,0x0089,0x008A " -j REJECT