how to create Custom iptables Rule for second ip address on the server

Post Reply
stambol
Junior Member
Posts: 1
Joined: 09 Feb 2016, 21:02

how to create Custom iptables Rule for second ip address on the server

Post by stambol »

Hi,

On my server I have 2 IP addresses, let say xxx.xxx.xxx.xxx and xxx.xxx.xxx.yyy so what I want is to filter traffic with csf on the xxx.xxx.xxx.xxx IP and allow everything for xxx.xxx.xxx.yyy so in short the second IP xxx.xxx.xxx.yyy be completely ignored by csf and allow all the traffic.

I have tried as described here: http://tecadmin.net/add-custom-iptables-rules-with-csf/# but it is not working, the csf rules after restart are implemented to both IP addresses.

Can someone please tell me how to do this?

Thank you,
Sergio
Junior Member
Posts: 1715
Joined: 12 Dec 2006, 14:56

Re: how to create Custom iptables Rule for second ip address on the server

Post by Sergio »

Check the readme file for the following:
# Advanced port+ip filtering allowed with the following format
# tcp/udp|in/out|s/d=port|s/d=ip
add those lines to the "firewall allow IPs" with all the destinations ports open and the destination IP xxx.xxx.xxx.yyy, that could achieve what you want, but letting an IP to ignore the firewall will be a great security flaw.
Post Reply