Limit private IP access onlyiptables blocking from internet side on eth1?How to block access to “private”...

Can a nowhere continuous function have a connected graph?

Reusable spacecraft: why still have fairings detach, instead of open/close?

Movie with Zoltar in a trailer park named Paradise and a boy playing a video game then being recruited by aliens to fight in space

Different budgets within roommate group

Can SOCPs approximate better than LPs?

Prime parity peregrination

What's the safest way to inform a new user of their password on an invite-only website?

Closest Proximity of Oceans to Freshwater Springs

Can European countries bypass the EU and make their own individual trade deal with the U.S.?

Using the ArcGIS 'select by location' tool in ModelBuilder?

Grant dbcreator only for databases matching prefix

Using “ser” without "un/una"?

Why wasn't EBCDIC designed with contiguous alphanumeric characters?

Are gliders susceptible to bird strikes?

I need help with pasta

The warming up game

Company threatening to call my current job after I declined their offer

Losing queen and then winning the game

What is this mount with two buttons on side of Vivitar 75-205mm lens?

Which is better for keeping data: primary partition or logical partition?

Could human civilization live 150 years in a nuclear-powered aircraft carrier colony without resorting to mass killing/ cannibalism?

Adjective for 'made of pus' or 'corrupted by pus' or something of something of pus

How to describe POV characters?

"Vector quantity" --More than two dimensions?



Limit private IP access only


iptables blocking from internet side on eth1?How to block access to “private” host-only network from VirtualBox nat interface (separate host-only networks)?secure my servers with iptablesRoute outging traffic from private network (lxdbr0)select a private network interfaceTo block outgoing connections from redhat 7 using firewall-cmdFirewalld : Blacklist certain port to an IP RangeBlock or drop DNS requests within forwarded packetsiptables SNAT limit to specific networkHow do I block public port(3306) access in Linux but allow from other nodes on local network?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Is that possible to forbid the outgoing public IP address and access private IP only?



10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255


I know there is a way to drop IP via iptables



iptables -I OUTPUT-s 11.0.0.0 -j DROP
... etc


Is there a convenient way to block all of them?










share|improve this question























  • Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

    – Colin Wu
    1 hour ago


















0















Is that possible to forbid the outgoing public IP address and access private IP only?



10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255


I know there is a way to drop IP via iptables



iptables -I OUTPUT-s 11.0.0.0 -j DROP
... etc


Is there a convenient way to block all of them?










share|improve this question























  • Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

    – Colin Wu
    1 hour ago














0












0








0








Is that possible to forbid the outgoing public IP address and access private IP only?



10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255


I know there is a way to drop IP via iptables



iptables -I OUTPUT-s 11.0.0.0 -j DROP
... etc


Is there a convenient way to block all of them?










share|improve this question














Is that possible to forbid the outgoing public IP address and access private IP only?



10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255


I know there is a way to drop IP via iptables



iptables -I OUTPUT-s 11.0.0.0 -j DROP
... etc


Is there a convenient way to block all of them?







linux networking iptables






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 1 hour ago









Coda ChangCoda Chang

1054 bronze badges




1054 bronze badges













  • Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

    – Colin Wu
    1 hour ago



















  • Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

    – Colin Wu
    1 hour ago

















Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

– Colin Wu
1 hour ago





Just so I understand, you want your machine to ONLY be able to access the private IP ranges and not be able to access ANY public IPs?

– Colin Wu
1 hour ago










1 Answer
1






active

oldest

votes


















0














iptables -A OUTPUT -d. 10.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -d 172.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -d 192.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -d 127.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -j DROP





share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f527141%2flimit-private-ip-access-only%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    iptables -A OUTPUT -d. 10.0.0.0/4 -j ACCEPT
    iptables -A OUTPUT -d 172.0.0.0/4 -j ACCEPT
    iptables -A OUTPUT -d 192.0.0.0/4 -j ACCEPT
    iptables -A OUTPUT -d 127.0.0.0/4 -j ACCEPT
    iptables -A OUTPUT -j DROP





    share|improve this answer




























      0














      iptables -A OUTPUT -d. 10.0.0.0/4 -j ACCEPT
      iptables -A OUTPUT -d 172.0.0.0/4 -j ACCEPT
      iptables -A OUTPUT -d 192.0.0.0/4 -j ACCEPT
      iptables -A OUTPUT -d 127.0.0.0/4 -j ACCEPT
      iptables -A OUTPUT -j DROP





      share|improve this answer


























        0












        0








        0







        iptables -A OUTPUT -d. 10.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 172.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 192.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 127.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -j DROP





        share|improve this answer













        iptables -A OUTPUT -d. 10.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 172.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 192.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -d 127.0.0.0/4 -j ACCEPT
        iptables -A OUTPUT -j DROP






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        user1133275user1133275

        4,0421 gold badge10 silver badges25 bronze badges




        4,0421 gold badge10 silver badges25 bronze badges






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f527141%2flimit-private-ip-access-only%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

            The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

            Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...