Can somebody come up with (an) Ubuntu command line(s) that will allow me to deal with a specific site and block all other IP’s, preferably using ufw, but if not, iptables?
1 Answer
As I write this it's not clear what you're looking for (and commenting that you're engaged in internet banking doesn't help one bit), but here's my guess: are you looking for a way to configure your firewall so that it allows traffic to and from only one particular IP address and blocks everything else? If so, here are the IPtables commands to do that:
iptables -I INPUT 0 --src ! xxx.xxx.xxx.xxx -j DROP
iptables -I OUTPUT 0 --dst ! xxx.xxx.xxx.xxx -j DROP
and then to reset it afterwards (assuming you haven't made any other changes to the firewall in the interim):
iptables -D INPUT 0
iptables -D OUTPUT 0
-
-
Nevertheless, I’m getting an error message about the ‘0’ in the string (Ubuntu 9.04).– AnonymousOct 4, 2009 at 22:53