Which ports should I open for apt-get to work?

7,744

Make sure you accept also connection originated from inside. With iptables:

iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT

With Webmin, allow

Connection states EQUALS Existing Connection
Share:
7,744

Related videos on Youtube

Juan Furattini
Author by

Juan Furattini

Updated on September 18, 2022

Comments

  • Juan Furattini
    Juan Furattini almost 2 years

    I installed Webmin, and then set up the firewall like this:

    INPUT
    SSH port ALLOWED
    Webmin port ALLOWED
    HTTP port (80) ALLOWED
    DROP EVERYTHING ELSE
    
    FORWARDING
    no rules
    
    OUTPUT
    no rules

    If I remove DROP EVERYTHING ELSE from INPUT, everything works.

    However, when that rule is added, apt-get doesn't work, and I can't ping or traceroute anything.

    Even with DROP EVERYTHING ELSE enabled, Webmin, HTTP and SSH still work.

    Which ports should I unblock to get apt-get working and allowed connecting to other domains from within the server?

    Thanks

    • Admin
      Admin about 9 years
      Try port 22 or 21
  • Juan Furattini
    Juan Furattini about 9 years
    Hello, this works fine.Thanks! P.S. to do this on Webmin (for anyone who finds this on Google) you need to choose "Connection states EQUALS Existing Connection"