diff --git a/lib/bettercap/firewalls/linux.rb b/lib/bettercap/firewalls/linux.rb index 771e25ec..b6b0d839 100644 --- a/lib/bettercap/firewalls/linux.rb +++ b/lib/bettercap/firewalls/linux.rb @@ -31,14 +31,14 @@ def add_port_redirection( iface, proto, from, addr, to ) # accept all shell.execute('iptables -P FORWARD ACCEPT') # add redirection - shell.execute("iptables -t nat -A PREROUTING -i #{iface} -p #{proto} --dport #{from} -j REDIRECT --to #{addr}:#{to}") + shell.execute("iptables -t nat -A PREROUTING -i #{iface} -p #{proto} --dport #{from} -j DNAT --to #{addr}:#{to}") end def del_port_redirection( iface, proto, from, addr, to ) # remove post route shell.execute('iptables -t nat -D POSTROUTING -s 0/0 -j MASQUERADE') # remove redirection - shell.execute("iptables -t nat -D PREROUTING -i #{iface} -p #{proto} --dport #{from} -j REDIRECT --to #{addr}:#{to}") + shell.execute("iptables -t nat -D PREROUTING -i #{iface} -p #{proto} --dport #{from} -j DNAT --to #{addr}:#{to}") end private