By hodkinsona
For some reason my iptables are causing problems for yum. Even more stranger, when I run “iptables -F” to flush the chain, it disconnects me and refuses connection on any port from any ip address. After a force reboot from the control panel, then it allows me to reconnect.
Chain INPUT (policy DROP) ACCEPT TCP DPT:80 ACCEPT TCP DPT:21
Chain FORWARD (policy DROP)
Chain OUTPUT (policy ACCEPT)
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!
By running iptables -F you are ‘flushing’ the rules, not affecting the default policy. In your case, it is set to ‘DROP’ which means that, now that all the rules are gone, all packets will be dropped.
You’d want to run iptables -X afterwards to reset everything else to the defaults. So
iptables -F
iptables -X
should allow everything to go through.
What errors do you get when you try to use yum with your IPTables rules enabled? Can you post the output of:
sudo iptables -L -n
sudo iptables-save
I would personally change the default policy to ALLOW then append a DROP at the end of your INPUT Chain, so for instances like what you described when you flush the rules you aren’t locked out.
I would also add a couple of rules in at the front of your INPUT Chain so your iptables-save looks like below
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -j DROP
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.