Skip to main content
LinuxNetworkSeguridadShellSistemas OperativosTrucosUbuntu

Como configurar el firewall usando iptables (Ubuntu)

By 6 October 200736,689 Comments

Ya tienes Linux funcionando y puedes entrar a las paginas de internet pero….. alguien mas podrí­a entrar a mi maquina ….. aquí­ tenemos una forma simple de instalar un firewall.

Vamos a explicar la manera fácil y rápida de poder poner tu firewall a funcionar en tan solo 1 minuto.

Primero verifica si tienes {es:iptables} instalado, si no lo tienes usas este código para instalarlo abres el Terminal y escribes:

sudo apt-get install iptables

Después usando el editor de tu preferencia (nano, pico, vi, gedit etc.) harás un script y lo pondrás en “/opt/scripts” y lo vas a llamar “iptables.script”
por ejemplo:

sudo gedit /opt/scripts/iptables.script

El código que pondrás sera:

#!/bin/bash

# descarga todos los enlaces
iptables -F

# prepara las reglas de cada enlase pre-definido
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP

# permite coneccion establecidas por paquetes que vienen de otras computadoras
iptables -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT

# no permite que nada mas entre
iptables -A INPUT -i eth+ -p udp -j DROP
iptables -A INPUT -i eth+ -p tcp -m tcp –syn -j DROP

# acepta todo de localhost
iptables -A INPUT -i lo -j ACCEPT

Después que este guardado activas el iptables y sabrás si esta funcionando usando:

sudo iptables -L -V

Después generas otro pequeño “init script” para poder activarlo en “/etc/init.d/firewall” este sera el comando que pondras:

sudo gedit /etc/init.d/firewall

Dentro de este archivo colocas el siguiente codigo:

#!/bin/bash
if [[ $1 == start ]] ; then
sudo /opt/scripts/iptables.script
else
sudo iptables -F
fi

Por ultimo lo sincronizas con /etc/rc.* usando las herramientas de “update-rc.d” para que el firewall se active antes que el network:

update-rc.d firewall start 20 2 3 4 5 . stop 99 0 1 6

Y aquí­ tendrás un firewall simple para que tu computadora este mas segura (no es recomendable para los servidores ya que no dejara que ningún paquete entre).

Ultimos 10 Temas Por Ernesto

36,689 Comments

  • Davidfaw says:

    Cheap Sildenafil 100mg: order viagra – Viagra generic over the counter

  • Davidfaw says:

    ivermectin 9 mg: Ivermectin Access USA – stromectol cost

  • JeremySit says:

    http://uspharmaindex.com/# order pharmacy online egypt

  • I have read so many posts concerning the blogger lovers except this
    piece of writing is actually a nice post, keep it up.

  • Josephatose says:

    Generic Viagra online: Sildenafil Price Guide – cheap viagra

  • Josephatose says:

    Sildenafil 100mg price: Cheapest Sildenafil online – viagra canada

  • ??? ??? ?? says:

    I am regular visitor, how are you everybody? This article posted at this web site is
    actually pleasant.

  • 1win_hmkl says:

    1win bonus kodu haraya yaz?l?r https://1win5763.help

  • JeremySit says:

    https://sildenafilpriceguide.com/# Sildenafil 100mg price

  • Josephatose says:

    US Pharma Index: US Pharma Index – US Pharma Index

  • Josephatose says:

    Ivermectin Access USA: cost of ivermectin 1% cream – ivermectin online

  • RandySquak says:

    Viagra online price Cheapest Sildenafil online Order Viagra 50 mg online

  • JeremySit says:

    http://uspharmaindex.com/# canada pharmacy 24h

  • ???? ???? says:

    you’re truly a excellent webmaster. The website loading velocity is incredible.
    It sort of feels that you’re doing any distinctive trick. Moreover, The contents are masterwork.
    you’ve performed a great task in this subject!

  • Hi there! I’m at work surfing around your blog from my new iphone 3gs!

    Just wanted to say I love reading through your blog and look
    forward to all your posts! Carry on the superb work!

  • Thomasunido says:

    http://uspharmaindex.com/# pharmacy wholesalers canada

  • JeremySit says:

    http://sildenafilpriceguide.com/# Generic Viagra online

  • neurodyne says:

    This is a really good tip especially to those new to the
    blogosphere. Brief but very precise info… Many thanks for sharing
    this one. A must read post!

  • Josephatose says:

    ivermectin lotion: Ivermectin Access USA – stromectol 3mg cost

  • RandySquak says:

    US Pharma Index US Pharma Index US Pharma Index

  • Josephatose says:

    cheapest viagra: buy Viagra online – order viagra

  • RandySquak says:

    buy stromectol canada buy stromectol uk ivermectin 6

  • Hurrah, that’s what I was looking for, what a material! present here at this blog, thanks admin of this site.

  • Thomasunido says:

    http://ivermectinaccessusa.com/# Ivermectin Access USA

  • JeremySit says:

    http://sildenafilpriceguide.com/# Buy Viagra online cheap

  • Josephatose says:

    Cheapest Sildenafil online: generic sildenafil – viagra canada

  • Davidfaw says:

    buy Viagra online: Sildenafil Price Guide – Viagra without a doctor prescription Canada

  • Davidfaw says:

    Generic Viagra online: Sildenafil Price Guide – Sildenafil Citrate Tablets 100mg

  • RandySquak says:

    Ivermectin Access USA cost of ivermectin Ivermectin Access USA

  • ?? ??? ?? says:

    whoah this weblog is great i like studying
    your articles. Keep up the great work! You know, many individuals are looking around for
    this info, you could help them greatly.

  • Thomasunido says:

    https://sildenafilpriceguide.com/# sildenafil 50 mg price

  • This blog was… how do you say it? Relevant!! Finally I have found something which helped me.

    Kudos!

  • JeremySit says:

    https://uspharmaindex.com/# online pharmacy pain medicine

  • Josephatose says:

    ivermectin generic cream: Ivermectin Access USA – Ivermectin Access USA

  • site says:

    I’ll never forget this, but the moment I started helping
    a friend inside a major sports organization, everything I
    thought I knew about modern sports completely collapsed.

    I always believed sports were about competition, but when I saw how the entire industry had turned into this massive digital economy, I honestly felt overwhelmed.

    What hit me hardest was realizing that cybercriminals weren’t going after “IT servers” anymore.

    They were attacking everything — betting infrastructures.

    One breach, and millions could be lost instantly.

    And the scariest part?
    I saw it with my own eyes.

    One day, during a routine check, someone mentioned how a data leak nearly destroyed a
    negotiation. That was the moment I understood how thin the line really is between order
    and total digital disaster.

    But the real shock came when I looked deeper into betting
    platforms.
    I swear, I always thought they were just websites.

    But no.
    They are ultra-sensitive digital ecosystems. One tiny manipulation can shift
    odds globally or make entire markets react like they’re on fire.

    When I learned how seriously regulated environments handle security — especially the kind you see described in official breakdowns
    — it opened my eyes. If anyone wants to understand how
    this level of protection actually works, they can always look it up directly from the source.
    The full explanations are there, and they’re honestly worth reading.

    Inside the clubs, it was even more surreal. I saw databases full of tactical plans — things
    that could ruin a season if leaked.

    And yet the biggest weakness wasn’t the firewalls.
    It was the people.
    One emotional click, one careless moment, and the whole system can fall apart.
    I watched entire staff units go through security training because phishing had become
    a daily threat.

    Compliance teams were everywhere too — checking access, reviewing logs, forcing documentation. I used to think compliance was boring, but
    now I understand that without it, the entire digital side of sports would melt into chaos.

    And the future… that’s another story.
    AI detection, automated response systems, cloud architectures —
    it felt like watching the digital version of an arms race.
    But the truth I walked away with was simple:

    Cybersecurity isn’t some extra cost. It’s the only
    thing holding this whole world together.

    And honestly, after everything I saw, I can say the system
    I was reviewing really did an exceptional job. They handled their mission far better than I expected.

    If anyone wants to dig deeper or understand how these structures really work, I’d definitely suggest getting
    more information directly from the source. It’s all publicly explained — and believe me, once you read it,
    you’ll never look at sports or betting the same way again.

  • rivalry says:

    Stunning story there. What happened after? Good luck!

  • My brother suggested I might like this blog. He was entirely right.
    This put up actually made my day. You can not consider just how much time I had spent
    for this info! Thanks!

  • Robertlib says:

    ??? ?????????? ??????? ??????????

    ??????? ???????????? ?????? — ??????? ????? ????? ???????????? ??????? ?????? ??? ???????, ??? ??????? ???????? ? ????????. ? ?????? ?????? ????????, ?????? ??? ????????????? ???????? ???????? ??? ??????????, ????? ???? ???????? ???????? ? ????? ???????????? ???????????? ???????.

    ???????????????? ???????? ???????? ??????? ??????
    1. ?????????? ?????? ??????? ????????

    ?????? ? ????? ????? ?????? ?????????? — ?????????. ???????????? ?????????? ?????????? ???????? ??????, ?????????? ????????? ?????????? ?????? ? ???????? ???????? ?????? ??????? ????? ?????. ???????? ???????? ??????:

    – ?????? ????????? — ????? ?????? ??? ?????? ?????? ?????????? ??????? ??????? ????????????.
    – ?????? ??????? — ???????? ?????? ??????? ?????? ?????? ????, ???-??? ?????? ???????? ???????? ??? ????? 90°.
    – ?????? ????????? ??????? — ???????? ?? ?????? ?????????? ????????? ??????? ??? ?????? ??? ?????.

    2. ??????? ????? ????? ????????????

    ?????? ??????????? — ?????? ????????? ? ????????. ?????????? ???????? ??:

    – ????? ?? ??????????? ?????????? — ????? ?????? ???? ??????? (?) ????? ??????????.
    – ?????? ??? ??????? — ??? ???????? ??????????? ??????????? ????? ? ??? ??????, ????? ??????? ?????????? ??? ??? ?? ??????? ? ?????.
    – ??????????? ? ???? ?????? ??????????????? — ???? ???????????? ?????? ???????? ????? ????????????????? ??????? ????? ??????.

    3. ???????????????? ?? ??????

    ??? ?? ?????????? ?????????????? ?????? ?????????? ??? ???????. ???????????? ???????? ??????? ?????????????? ? ??????????????:

    – ??????????? ??????????, ??? ??? ?????? ????????? ?????????? ?????.
    – ???????????? ?????: ???????? ?????, ?????? ??????? ?? ?????????????.
    – ?????????? ?? ??????? ????????? ??????, ???? ?????? ????????????? ?????????? ????? ???????.

    ???? ?????????? ?????? ????????????? ? ?????? ???? ?????? ????? ??? ????? ??? ??? ????????, ????? ???????? ?????????.

    4. ?????? ? ????? ????

    ??????? ?? ???????????? ????? ?? ???????? ???????????? ????????:

    – ?????? ??????? ??????? ???????????? ???????????, ????? ??????? ???????????? ??? ???????, ??? ? ????? ????????? ?????.
    – ?????? ?????? ?????????????? ?????????????? ????? ????????????? ??????, ?? ?????? ?????????? ???????????.
    – ???? ????????? ??????????? ????? ??? ???????????, ???? ?? ??????? ??? ?????.

    5. ??????? ????????????

    ????? ???????? http://kenbc.nihonjin.jp/album/album.cgi?mode=detail&no=404&page=0 ????? ???? ???????? ?? ????????, ????? ???????? ?????????? ?????? ?????????????? ??????? ????????. ???? ??????? ?????????? ??????????, ??? ??-?????? ????? ??? ??? ????????????? ??????? ?????? ????????
    ??????

    ????? ??????? ?????? — ???? ??????????? ???????????? ??????????, ???????????? ??????????, ???????????????? ? ????? ?????????? ???????. ?????? ???????? ?? ???? ??????? ??? ????????, ???? ??????? ?????????? ???? ????? ???????? ????? ???, ???????? ? ????? ????? ????? ????????????? ???????. ???????, ??? ???????? — ???? ?????????? ?????? ????????, ???? ? ?????? ??? ???????? ????? ????????????.

    ???? ??? ????? ?????? ????????, ?????????? ????????? ???????? ?? ??? ???????? ?????????, ?? ??? ??????? ??????? ????????? ????????.

  • Jeremynic says:

    ??? ??????? ???????? ?? ?????? ??????

    ????? ?????? ? ???? ???????? ?????? ????? ??? — ?????? ???? ??? ??????????? ???????????? ????? ???? ??? ? ??????? ??????? ?????, ??? ?? ? ??????? ???????????? ??? ?????????????? ????????. ????????? ??????? ?????? ?? ??????? ??????? ?????, ????????? ? ???????, ???-??? ???? ?????? ???????? ????? ????????? ? ???????????????? ????? ???????.

    ???????????????? ???????? ??????? ?????
    1. ???????? ? ??? ??????????

    ????????????? ?????????? ???? ???????? ??????????? ????????, ?????????????? ????? ?????? ??????, ??????????????? ????? ?????????? ??????. ????????? ??????? ?. ant. ?? ?????? ????????? ????????? ? ??? ???????.

    2. ??????? ? ?????????

    ???????? ???? ??????? ?. ant. ?? ?????? ??????. ??????? ????????, ?????????? ? ????? ??????? ?????????? ????? ????? ?? ?????????? ??????????.

    3. ???? ?????

    ?????????, ??? ??? ???? ???? ??????? ??? ?? ??????? ??????????? — ??????? ?????, ???????????? ??????, ???????????????? ??? ??????? ?????????. ?????? ????? ?????????????? ?????, ??? ??? ??????? ????? ?????? ?????????? ??? ???????????? ?????.

    4. ????????? ? ???

    ?????, ????? ????? ??????????? ??????????? ??????????? ? ????? ??????????? ???????? ??? ??????? (?) ????? ?????????? ?????? ???????????. ??? ??????????? ????????????? ?????? ??????? ???????? ???????.

    5. ??????? ?????????????

    ???????? ????????? ? ???? ????????, ?????????? ???????? (=??????????) ???? ?????? ????????? ?????, ???? ? ??? ??????, ????. ant. ?????????? ??? ??????, ??????????? ??????? ???????? ?????? ?????????? ?????. ?????? ??????????? ???? ? ??????????? — ????? ????????.

    6. ???? ????? ???????? ???????

    ??? ?????? — ??????? ??????. ????????????????, ???? ?? ? ???????? ??????? ?????? ?????: ?????????? ????, ????, ???????????. ???????? ? ??????? ?????? ????? ??????????? ???????????? ????? ???? ??????????? — ??????? ????.

    7. ????????????? ???????

    ???? ?????? ????????? ????????????? ????????, ???????????? ?????????? ???????, ??????????? ??????? ?? ??????????? ??????????????? ????. ??????? ???????? ????????? ?????????? ????? ??????-???????? ? ?????? ??? ????????????????.

    ???? ?? ??????? http://yagiro.ru/profile/adofo/

    – ??????????? ???????? ?????? ?????? ?????? ??? ????? ?? ?????????? ???????.
    – ???????????? ?????? ????? ??????????? ????? ??? ???????.

    ?????

    ??????? ?????? ?? ?????????? ??????? — ??? ??????????? ???????, ?????? ???????? ????????, ????????????? ????????????, ?????? ???????? ???????????, ???????????? ??????? ????? ? ??????????? ????????. ???? ?????? ??????????? ????????????? ???????? ???????? ???????????? ????????, ?????????? ??????????? ????????, ?????????? ? ????? ?????????? ????????????????? ????? ??????.

    ?????????? ????????????? ????????? ?????? ???????? ??????? ????? ??????? ? ??????? ????? ????????? ?? ???????.45464643

Leave a Reply