IPTABLES CONFIGURATION CIDR notation











up vote
0
down vote

favorite












WINPE1 = 192.168.10.5
iptables -A INPUT -p tcp -s 192.168.10.5 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP



iptables -A INPUT -s 192.168.10.5 -p ICMP --icmp-type 8 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP



I have written this rules in response to these guidelines
• Only allow HTTPD traffic from WINPE1. Use an ACCEPT command. We are implementing a DROP policy.
• Allow Ping traffic from WINPE1 only. Again use an ACCEPT command.



However in the guidelines it is stated that Subnet addressing (like 192.160.10.0/24 for example) must be used throughout the firewall, no individual IP addresses allowed for source machines and no specified ranges allowed either e.g. --src-range 192.168.1.100-192.168.1.200.
How do I change the 192.168.10.5 address to cidr notation without granting access to other ip addresses?










share|improve this question









New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3




    I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
    – thrig
    Nov 21 at 20:31















up vote
0
down vote

favorite












WINPE1 = 192.168.10.5
iptables -A INPUT -p tcp -s 192.168.10.5 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP



iptables -A INPUT -s 192.168.10.5 -p ICMP --icmp-type 8 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP



I have written this rules in response to these guidelines
• Only allow HTTPD traffic from WINPE1. Use an ACCEPT command. We are implementing a DROP policy.
• Allow Ping traffic from WINPE1 only. Again use an ACCEPT command.



However in the guidelines it is stated that Subnet addressing (like 192.160.10.0/24 for example) must be used throughout the firewall, no individual IP addresses allowed for source machines and no specified ranges allowed either e.g. --src-range 192.168.1.100-192.168.1.200.
How do I change the 192.168.10.5 address to cidr notation without granting access to other ip addresses?










share|improve this question









New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3




    I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
    – thrig
    Nov 21 at 20:31













up vote
0
down vote

favorite









up vote
0
down vote

favorite











WINPE1 = 192.168.10.5
iptables -A INPUT -p tcp -s 192.168.10.5 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP



iptables -A INPUT -s 192.168.10.5 -p ICMP --icmp-type 8 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP



I have written this rules in response to these guidelines
• Only allow HTTPD traffic from WINPE1. Use an ACCEPT command. We are implementing a DROP policy.
• Allow Ping traffic from WINPE1 only. Again use an ACCEPT command.



However in the guidelines it is stated that Subnet addressing (like 192.160.10.0/24 for example) must be used throughout the firewall, no individual IP addresses allowed for source machines and no specified ranges allowed either e.g. --src-range 192.168.1.100-192.168.1.200.
How do I change the 192.168.10.5 address to cidr notation without granting access to other ip addresses?










share|improve this question









New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











WINPE1 = 192.168.10.5
iptables -A INPUT -p tcp -s 192.168.10.5 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP



iptables -A INPUT -s 192.168.10.5 -p ICMP --icmp-type 8 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP



I have written this rules in response to these guidelines
• Only allow HTTPD traffic from WINPE1. Use an ACCEPT command. We are implementing a DROP policy.
• Allow Ping traffic from WINPE1 only. Again use an ACCEPT command.



However in the guidelines it is stated that Subnet addressing (like 192.160.10.0/24 for example) must be used throughout the firewall, no individual IP addresses allowed for source machines and no specified ranges allowed either e.g. --src-range 192.168.1.100-192.168.1.200.
How do I change the 192.168.10.5 address to cidr notation without granting access to other ip addresses?







firewall






share|improve this question









New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 21 at 21:44









Community

1




1






New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 21 at 20:19









abignetworknoob

1




1




New contributor




abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






abignetworknoob is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 3




    I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
    – thrig
    Nov 21 at 20:31














  • 3




    I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
    – thrig
    Nov 21 at 20:31








3




3




I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
– thrig
Nov 21 at 20:31




I've never seen 192.160.10.024 used, why the backslash instead of a forward slash?
– thrig
Nov 21 at 20:31










1 Answer
1






active

oldest

votes

















up vote
2
down vote













iptables is able to handle networks realy easy.
In your case:



iptables -A INPUT -p tcp -s 192.168.10.0/24 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -s 192.168.10.0/24 -p ICMP --icmp-type 8 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP


Or instead of 192.168.10.0/24 you can use 192.168.10.0/255.255.255.0






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',
    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
    });


    }
    });






    abignetworknoob is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483294%2fiptables-configuration-cidr-notation%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








    up vote
    2
    down vote













    iptables is able to handle networks realy easy.
    In your case:



    iptables -A INPUT -p tcp -s 192.168.10.0/24 --dport 80 -j ACCEPT
    iptables -A INPUT -p tcp --dport 80 -j DROP
    iptables -A INPUT -s 192.168.10.0/24 -p ICMP --icmp-type 8 -j ACCEPT
    iptables -A INPUT -p ICMP --icmp-type 8 -j DROP


    Or instead of 192.168.10.0/24 you can use 192.168.10.0/255.255.255.0






    share|improve this answer

























      up vote
      2
      down vote













      iptables is able to handle networks realy easy.
      In your case:



      iptables -A INPUT -p tcp -s 192.168.10.0/24 --dport 80 -j ACCEPT
      iptables -A INPUT -p tcp --dport 80 -j DROP
      iptables -A INPUT -s 192.168.10.0/24 -p ICMP --icmp-type 8 -j ACCEPT
      iptables -A INPUT -p ICMP --icmp-type 8 -j DROP


      Or instead of 192.168.10.0/24 you can use 192.168.10.0/255.255.255.0






      share|improve this answer























        up vote
        2
        down vote










        up vote
        2
        down vote









        iptables is able to handle networks realy easy.
        In your case:



        iptables -A INPUT -p tcp -s 192.168.10.0/24 --dport 80 -j ACCEPT
        iptables -A INPUT -p tcp --dport 80 -j DROP
        iptables -A INPUT -s 192.168.10.0/24 -p ICMP --icmp-type 8 -j ACCEPT
        iptables -A INPUT -p ICMP --icmp-type 8 -j DROP


        Or instead of 192.168.10.0/24 you can use 192.168.10.0/255.255.255.0






        share|improve this answer












        iptables is able to handle networks realy easy.
        In your case:



        iptables -A INPUT -p tcp -s 192.168.10.0/24 --dport 80 -j ACCEPT
        iptables -A INPUT -p tcp --dport 80 -j DROP
        iptables -A INPUT -s 192.168.10.0/24 -p ICMP --icmp-type 8 -j ACCEPT
        iptables -A INPUT -p ICMP --icmp-type 8 -j DROP


        Or instead of 192.168.10.0/24 you can use 192.168.10.0/255.255.255.0







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 at 21:33









        Alexander

        993113




        993113






















            abignetworknoob is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            abignetworknoob is a new contributor. Be nice, and check out our Code of Conduct.













            abignetworknoob is a new contributor. Be nice, and check out our Code of Conduct.












            abignetworknoob is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483294%2fiptables-configuration-cidr-notation%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

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt