Quote Originally Posted by pedrommone View Post
And its giving me this error in all output connections, someone understand why? In another ubuntu 12.04 vps its working well, but recently i've bought a softlayer vps and its buggyng.
Myself, I think you have answered your own question, there are issues with your softlayer vps (or, and as kevdog said, you might need to flush some old stuff , which I do).

I ran your rules on a test computer and they worked fine.
Code:
doug@test-smy:~$ cat fw_05
#!/bin/sh

sudo iptables -F INPUT
sudo iptables -F OUTPUT

sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT DROP

sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A OUTPUT -o lo -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -A OUTPUT -o eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A OUTPUT -o eth0 -p udp --dport 53 -j ACCEPT
Code:
doug@test-smy:~$ wget google.com
--2013-05-26 17:42:31--  http://google.com/
Resolving google.com (google.com)... 173.194.33.41, 173.194.33.46, 173.194.33.32, ...
Connecting to google.com (google.com)|173.194.33.41|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2013-05-26 17:42:31--  http://www.google.com/
Resolving www.google.com (www.google.com)... 74.125.129.105, 74.125.129.106, 74.125.129.147, ...
Connecting to www.google.com (www.google.com)|74.125.129.105|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.ca/ [following]
--2013-05-26 17:42:31--  http://www.google.ca/
Resolving www.google.ca (www.google.ca)... 74.125.129.94, 2607:f8b0:400e:c02::5e
Connecting to www.google.ca (www.google.ca)|74.125.129.94|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: "index.html"
2013-05-26 17:42:32 (741 KB/s) - "index.html" saved [11003]
Code:
doug@test-smy:~$ sudo iptables -v -x -n -L
Chain INPUT (policy DROP 16 packets, 1217 bytes)
    pkts      bytes target     prot opt in     out     source               destination
     246    29951 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
       0        0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
       2      144 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy DROP 14 packets, 1824 bytes)
    pkts      bytes target     prot opt in     out     source               destination
     306    35795 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
       0        0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0
       3      180 ACCEPT     tcp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            tcp dpt:80
      18     1172 ACCEPT     udp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            udp dpt:53