Relative Content

Tag Archive for iptables

How to configure iptables to send RST on timed out connections?

There is firewall between client and db server. Sometimes when there is not traffic to client the connection between client and server becomes idle and the firewall silently drops the connection. After this if client hangs if tries to communicate using same socket. A new connection would work.

How to allow only one user agent in IPTABLES

I have apache server and one service running behind apache port on 9922. So, I want to allow only one user agent to 9922 port, other all application must be denied by iptables rule. Please someone can send me rules? My current configuration as “-A INPUT -p tcp -m tcp –dport 9922 -m string –string “curl” –algo bm –to 65535 -j ACCEPT” but on this configure all app access to 9922. Which additional rules denied all user agent(only curl must access)?

Where do the messages intercepted by iptables go?

I set up a transparent proxy with iptables on a gateway to intercept UDP messages from devices within a subnet. After setting the rules, the devices no longer receive the messages, but the gateway does not forward them to the port specified in my commands. What could be the reason?Below are the specific commands I set up
iptables -t mangle -A PREROUTING -p udp -d 10.13.173.10 –dport 50003 -j TPROXY –on-port 10006 –on-ip 127.0.0.1 –tproxy-mark 0x7/0x7
ip rule add fwmark 7 lookup 199
ip route add local 0.0.0.0/0 dev lo table 199