Skip to main content
LinuxNetworkSeguridadShellSistemas OperativosTrucosUbuntu

Como configurar el firewall usando iptables (Ubuntu)

By 6 October 200736,511 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,511 Comments

  • Peterhoodo says:

    best online pharmacy no prescription http://pharmrate.com/# best mail order pharmacy

  • 1win_jiSl says:

    how to use 1win bonus code http://www.1win5530.ru

  • ?????? ??????? ???.
    ?????? ?????? – ?????? ??????? ???????????? ??????? ????????
    ???????? ???????? ?????? – ???? ?? ?????????? ????????? ? ????????, ??? ???? ????? ????? ???, ????????? ????????? ? ??????, ????? ????????? ?? ?????? ? ????? ?????? ?????? ? ?????????. ???????? ?????????????? ?????? ???????????, ? ????? ????????? ????????? ?????????????.
    ??? ????? ?????? ? ???????? ?? ????? Kraken
    ?? ????? ????? ????? ????? ?????? ? ??????:
    • ??????? ??????????? ????????????? ??????? – ?? ????????? ? ???????????? ?? ??????? ? ????????????.
    • ????????????? ?????????.
    • ??????? ???????? ???.
    • ?????? ???????.
    • ????????, ?????????????, ???????????? ?????.
    • ?????????? ? SIM ?????.
    • ????????? ?????? – ?????? – ?? 1000 ?? 5000 ??????.
    • ???????????? ? ??????? – ?? ??????? ????? ? ?????? ?? ?????? ??? ??????.
    ?????? ??????? ? ??????????. ????????, ????? ???????? ??? ?????????, ??????? ??? ????????. ????? ????? ?????????.
    ????????? ?????? ????????
    ??????? ??? ?????? ???????? Kraken:
    • ??????? ??????? ?????????????????? ???? ?????????? ?????? ????????? ???????????? ? ????????.
    • ?????????? ??????????? ??? ????????. ??? ??????????? ?????????????? ????????????.
    • ?????? ? ??????? ????? ????? ??????. ???????? ??? ?? ????? – ???? ?????, ????? ????????.
    • ???????? ?????????? ?????????????. ??????????? ???????? ???????? ?????????? ? ????????????, ????????? 24 ???? ? ?????.
    • ??????????? ???????, ??????? ????????? ?????? ????? ?????? ????????.
    • ???????? ? ?????? ?????? ?????? ? ???. ???????? ??????? ???????? ????? ????????????.
    ?? ???????? ????? ????????? ???????????? ??????. ? ????? ????? ??? ????? ???????????????????? ? ??????-?????????? ??? ???????. ? ???? ????????? ???????? – ?????????? ? ????????????, ?????????? ? ????? ?????.
    ??? ???? ??????????? ??????? – ??????? ?????? ??????. ???? ?? ?????? ? ????????????? ?????? ?????? ?????. ?? ?????? ???? ???????? ???????, ??????? ? ?????????? ?? ?????? ???????????. ? ???? ?????????? ????????????? ??????? ? ?????? ??? ??????? ???????????.

  • ?????? ???? ?????????.
    ?????? Kraken – ?????? ???????? ???????? ? Darknet
    ?????? Kraken Onion – ???? ?? ?????????? ????????? ? ????????, ??? ???? ????? ????? ??????????? ???????????? ?????????, ?????????? ????????, ???????? ? ?????????????, ???????????? ????? ?????? ? ?????? ??????????. ??????????? ?????????????? ?????? ???????????, ? ????? ????????? ????????? ?????????????.
    ?????? ? ?????? ?? ????? Kraken
    ?? ????? ??????????? ????? ?????? ? ??????:
    • ??????? ??????????? ?????????? – ?? ?????? ? ???? ?? ??? ? ???????.
    • ????????? ?????????.
    • ?????????? ???????? VPN.
    • ?????? ???????.
    • ????????, ?????????????, ???????????? ?????.
    • ?????????? ? ?????????? ?????.
    • ????????? ?????? – ?????? – ?? 1000 ?? 5000 ??????.
    • ??????? ? ?????????? – ??????, ?????, ??????????? ?????.
    ?????? ??????? ? ????? ??????. ? ??? ?????, ?????????? ???????????, ???????? ??? ???, ??? ?????????? ????????. ???? ??????????? ????? ?????????.
    ????????? ?????? ?????
    ???????? ???????????? ??????? ?? ???????:
    • ?????? ??????????? ???????? ? ?????????? ????????? ????????? ???????????? ? ????????.
    • ?????????? ??????????? ??? ?????????? ??????. ??? ??????????? ??????? ??????? ??????????????????.
    • ??????????? ??????? ????? ?? ????????? ????????. ????? ??? ?????????? – ???? ?????, ????? ???????.
    • ??????????? ???? ??????. ???????? ????? ?????? ??????????? ? ????????????, ????????? 24 ???? ? ?????.
    • ??????????? ???????, ??????? ????????? ?????? ????? ?????? ????????.
    • ???????????? ?? ? ???????? ???????. ???????? ??????? ???????? ???? ????????? ?????????? ??????.
    ???????? ??????? ???????? ?????????? ??????. ????????????? ??? ????? ???????? ???????????? ? ?????? ??? ?????????. ? ??? ????????? ??????? – ????????? ? ??????????, ?????????? ? ????? ?????.
    ??? ???? ??????????? ???????? – ??????? ?????? ??????. ???? ?? ?????? ? ????????????? ?????? ?????? ???????. ?? ????????? ?????? ????????? ???????? ???????, ?????????? ? ???????. ? ???? ???????????? ????????????? ??????? ? ?????? ??? ?????? ?????? ??????????? ??????.

  • Pedromum says:

    pet meds for dogs: Pet Canada Direct – Pet Canada Direct

  • evisa says:

    Hello There. I found your blog using msn. This is a very well written article.
    I will be sure to bookmark it and return to read
    more of your useful information. Thanks for the post. I’ll certainly comeback.

  • ???? ? ???????.
    ?????? ?????? – ?????? ???????? ???????? ? Darknet
    ???????? ???????? Kraken – ?????? ??????? ? ????????, ??? ????????? ?????? ??????????? ???????????? ?????????, ????????? ????????? ? ??????, ????? ????????? ?? ????? ?????? ? ?????? ??????????. ??????????? ????????????? ???????????? ??????????????????, ? ?????????? ????????? ??? ????? ??????.
    ?????? ? ?????? ?? ????? Kraken
    ? ????????? ??????? ??????????? ????? ?????? ? ??????:
    • ??????? ??????????? ????????????? ??????? – ?? ?????? ? ???? ?? ??????? ? ????????????.
    • ????????????? ?????????.
    • ??????? ???????? VPN-????????.
    • ?????? ???????.
    • ?????? ???? ??????????.
    • ?????????? ? ?????????? ?????.
    • ????????? ?????? – ? ????????, 1000, 2000 ? 5000 ???..
    • ???????????? ? ??????? – ?? ??????? ????? ? ?????? ?? ?????? ??? ??????.
    ?????? ??????? ? ??????????. ????????, ?????????? ???????? ??? ?????????, ???????? ??? ????????. ????? ?????? ????????? ????????? ? ?????? ??????.
    ????????? ?????? ????????
    ???????? ???????????? ???????? Kraken:
    • ??????? ??????? ?????????????????? ???????? ? ?????????? ????????? ????????? ???????????? ? ????????.
    • ????????????? BTC ??? ????????. ?????? ?????????? ???????????? ??????????? ???? ??????????.
    • ?????? ? ??????? ?? ????????? ????????. ????? ??? ?? ????? – ???? ?????, ????? ???????.
    • ???????? ?????????? ?????????????. ???????? ???????? ??????????? ? ????????????, ??????? ???????? ?????????????.
    • ??????? ????????, ??????????? ??????? ????? ????????????? ???????? ?????????.
    • ???????????? ?????? ? ???. ?????? ????????? ???? ???????? ????? ????????????.
    ????????????? ??????? ???????? ?????????? ?????????????? ??????. ????????????? ??? ????? ???????????????????? ? ??????-?????????? ??? ???????. ? ???? ????????? ???????? – ????????? ? ??????????, ??????? ???? ???????? ? ????? ?????.
    ?????????????? ???? ???????? – ??????????? ?????. ???? ?? ?????? ? ????????????? ?????? ?????? ???????. ?? ????????? ?????? ????????? ??????? ?????????, ??????? ? ?????????? ?? ?????? ???????????. ? ???? ???????????? ???????? ? ?????? ??? ??????? ??????????? ??????.

  • PatrickIndug says:

    https://pharmrate.shop/# Pharm Rate

  • evisa says:

    Terrific work! That is the kind of information that are supposed to
    be shared across the web. Disgrace on the search engines for not positioning this submit higher!
    Come on over and seek advice from my website
    . Thank you =)

  • GeorgeRef says:

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

    MRKT Skins CS2 ? ???????? ???

    ????? ?????? ? CS2 ?????????? ????????????. ???? ????? ???????????????? ? ??????????? ?? ?????????? ????, ?????? ?? ???????????? ?????, ? ????? ?? ?????? ????????? ?????????? ??????.

    MRKT Skins CS2 ???????? ????????????? ??? ?????????. ??? ????????? ??? ???????? ???????, ??? ??? ???? ??????????? ?????????? ??????? ????? ??? ??????? ??? ???????. ??? ??????? ??????????? ??? ???? ?????, ???? ????? ?? ????? ?????????????.

    ???? ???????? MRKT Skins CS2

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

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

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

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

    ????? ????? ??????????? http://www.spielhallen.net/mr-green-casino/?unapproved=1538388&moderation-hash=7af6e4cf0845e549c8563a1721735617#comment-1538388 ???????????????? ????????. ??????? ????? ???????????? ?????? ??????????? ??????? ? ??????????? ?????????? ? ?????? ??????????. ? ???????? ???????? ???????? ???????????? ?????? ??????.

    ?????

    MRKT Skins CS2 — ??? ?????????? ??????????? ??? ?????? ?? ??????? Counter-Strike 2. ?? ???????? ?????????, ?????????? ? ??????? ??????? ???????? ????? ??????????. ??? ???????? ?????? ??? ?????? ????? ???????? ????, ? ??? ???????? — ??????????? ????? ???????? ???????? ?????.

    ???? ???????????? MRKT Skins CS2 ?????????, ?? ????? ????? ??????? ?????????? ? ???? ???????? ??????? ???????. ??????? — ????????? ????????????, ????????????? ???? ? ????????? ?????????? ???????.

    ??????? ????

    MRKT Skins CS2 — ??? ???????? ???????? ??? ????, ??? ???????????? ?????????? CS2. ??? ???????? ????????, ???????? ??????????????? ?? ????? ? ????????? ??????????? ??? ??????????? ????????.

  • Do you have a spam problem on this blog; I also am a blogger,
    and I was wanting to know your situation; we have created
    some nice procedures and we are looking to trade techniques with other folks, please
    shoot me an e-mail if interested.

  • PatrickIndug says:

    http://petcanadadirect.com/# Pet Canada Direct

  • mostbet_qhka says:

    ??? ???????? ???????? mostbet http://mostbet92018.help

  • Jasonsmomb says:

    ed medicines online: ed online pharmacy – pharmacy no prescription required

  • vavada_hxsi says:

    vavada najnowszy kod promocyjny http://vavada2002.help/

  • 1win_thkn says:

    how to download 1win app http://1win5526.ru

  • PatrickIndug says:

    https://pharmrate.com/# Pharm Rate

  • Pedromum says:

    pet meds for dogs: online vet pharmacy – Pet Canada Direct

  • Charlesvak says:

    online ed drugs erectile dysfunction pills for sale reliable online pharmacy

  • PatrickIndug says:

    https://pharmrate.shop/# Pharm Rate

  • Charlesvak says:

    Pet Canada Direct pet drugs online Pet Canada Direct

  • Pedromum says:

    dog prescriptions online: Pet Canada Direct – pet meds online

  • Pedromum says:

    Pet Canada Direct: Pet Canada Direct – Pet Canada Direct

  • Jasonsmomb says:

    cheap erectile dysfunction pills: top rated ed pills – shop medicine online

  • Jasonsmomb says:

    Pharm Rate: Pharm Rate – overseas online pharmacy

  • Charlesvak says:

    Pet Canada Direct online pet pharmacy Pet Canada Direct

  • Jasonsmomb says:

    buy ed medication: generic ed meds online – online pharmacy without prescription

  • Peterhoodo says:

    no prescription needed pharmacy http://pharmrate.com/# us pharmacy no prescription

  • EdwardEvamb says:

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

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

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

    ????????? ???????? ?????????? ?? ?????? ???????? ??????, ?? ? ????? ????????????? ????????. ?????????????? ???????? ????? ????? ?????? ?????, ???????????? ????????????? ? ???? ???? ??????? ??? ???????? http://crossrood.sakura.ne.jp/cgi/bbs/crossrood.cgi

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

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

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

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

  • Peterhoodo says:

    online pharmacy no rx https://pharmrate.com/# Pharm Rate

  • 1win_vvkn says:

    1win create account 1win5526.ru

  • Pedromum says:

    online prescription for ed: best online ed pills – trustworthy online pharmacy

  • PatrickIndug says:

    https://petcanadadirect.shop/# Pet Canada Direct

  • PatrickIndug says:

    http://edmedscoupon.com/# cheapest erectile dysfunction pills

  • Jasonsmomb says:

    Pharm Rate: Pharm Rate – Pharm Rate

  • PatrickIndug says:

    https://edmedscoupon.shop/# cost of ed meds

Leave a Reply