Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If I want to forward port 80 to 8080 for a webserver listening on 8080, how would I do that in this table?
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080
use this…
I tried using
‘sudo iptables-save > /etc/sysconfig/iptables’
while logged in as superuser I created with all permissions, but got a permission denied. Did a little research and used the following command to save the configurations
‘sudo /etc/init.d/iptables save’ on CentOS
Additionally for Debian/Ubuntu I believe the command is
sudo vi /etc/network/interfaces
If I want to use postfix on my server to relay SMTP to gmail (i.e. send email from my server via gmail) ONLY, do I need any iptables rules? Right now, things are locked down to standard HTTP and SSH ports and that’s it. Not sure if I need to open up other ports to allow the relay.
@Mark: By default iptables does not block outgoing connections, but if it does not work for you, try adding this rule:
iptables -A OUTPUT -p tcp -m tcp --dport 25 -j ACCEPT
Like Arunava, if I used the command to save the iptables suggested in the article, I too was denied permission. The Red Hat Enterprise 6 manual says to use “service iptables save” to save the iptables. I used this command and the system reported the rules were saved to /etc/sysconfig/iptables.
Hello. I create the bash script. Check please
iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X
iptables -P INPUT DROP iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -m tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
iptables -I INPUT -m conntrack --ctstate NEW,INVALID -p tcp --tcp-flags SYN,ACK SYN,ACK -j REJECT --reject-with tcp-reset
iptables -I INPUT -m conntrack --ctstate NEW -p tcp ! --syn -j DROP
iptables -I INPUT -p icmp -f -j DROP
iptables -A INPUT -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 3 -j ACCEPT iptables -A INPUT -p icmp --icmp-type 11 -j ACCEPT iptables -A INPUT -p icmp --icmp-type 12 -j ACCEPT
iptables -A INPUT -p tcp --syn --dport 22 -m recent --name dmitro --set iptables -A INPUT -p tcp --syn --dport 22 -m recent --name dmitro --update --seconds 30 --hitcount 3 -j DROP iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -L --line-number echo echo “Adding DONE, maybe OK” echo “Saving to rc, PSE wait!” service iptables save echo service iptables restart echo “Done”
service iptables restart service network restart service openvpn restart
iptables -A INPUT -p tcp --dport 8083 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 465 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 110 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 995 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 143 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 993 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
@timepiece: I’m not sure what you mean – are you having any problems with that script?
Kamal Nasser: it’s work. I’m interesting, this script is normal? Can i use it?