Jump to content

Iptables - Remove Packet Mark On Certain Packets


Recommended Posts

I am using the following iptables script to redirect packets on port 443 to a proxy server:

iptables -t mangle -A PREROUTING -p tcp --dport 443 -j MARK --set-mark 2

 

I am redirecting it to my proxy server later on, which is working. For one host, however, I need to remove the iptables mark (i.e. the packets will not be redirected.) I tried the following:

iptables -t mangle -A PREROUTING -p tcp -s 192.168.0.47 --dport 443 -j ACCEPT

 

I have also tried (attempting to rewrite the mark to a different number):

iptables -t mangle -A PREROUTING -p tcp -s 192.168.0.47 --dport 443 -j MARK --set-mark 1

 

However none of them are working. Is there a --remove-mark? I couldn't find anything on Google.

Any help would be appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...