iptables: Logging connections on port 25/TCP

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have KVM virtualization. I have over 60 interfaces:



vnet1-60 - virtual;
vmbr0 - bridge;
enp2s0f0 - PHYSOUT;


I need to know how many connection make each vnet interface.
I have a rule like:



iptables -A FORWARD -o vnet1 -m state -p tcp --dport 25 --state NEW -j 
LOG --log-level 7 --log-prefix "25port: "


... but no result. Same no result:



-A OUTPUT -o vnet*;
-A OUTPUT -o vnet55,vnet56;
-A OUTPUT -o enp2s0f0;


I get logs only when I use this:



-A FORWARD -o vmbr0 -s 123.0.0.0/8 -m state -p tcp --dport 25 --state 
NEW -j LOG --log-level 7 --log-prefix "25port: "


... but this is not correct, because vmbr is the bridge.
How I can get traffic logs from virtual interfaces on port 25?







share|improve this question





















  • ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
    – A.B
    May 8 at 14:33














up vote
0
down vote

favorite












I have KVM virtualization. I have over 60 interfaces:



vnet1-60 - virtual;
vmbr0 - bridge;
enp2s0f0 - PHYSOUT;


I need to know how many connection make each vnet interface.
I have a rule like:



iptables -A FORWARD -o vnet1 -m state -p tcp --dport 25 --state NEW -j 
LOG --log-level 7 --log-prefix "25port: "


... but no result. Same no result:



-A OUTPUT -o vnet*;
-A OUTPUT -o vnet55,vnet56;
-A OUTPUT -o enp2s0f0;


I get logs only when I use this:



-A FORWARD -o vmbr0 -s 123.0.0.0/8 -m state -p tcp --dport 25 --state 
NEW -j LOG --log-level 7 --log-prefix "25port: "


... but this is not correct, because vmbr is the bridge.
How I can get traffic logs from virtual interfaces on port 25?







share|improve this question





















  • ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
    – A.B
    May 8 at 14:33












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have KVM virtualization. I have over 60 interfaces:



vnet1-60 - virtual;
vmbr0 - bridge;
enp2s0f0 - PHYSOUT;


I need to know how many connection make each vnet interface.
I have a rule like:



iptables -A FORWARD -o vnet1 -m state -p tcp --dport 25 --state NEW -j 
LOG --log-level 7 --log-prefix "25port: "


... but no result. Same no result:



-A OUTPUT -o vnet*;
-A OUTPUT -o vnet55,vnet56;
-A OUTPUT -o enp2s0f0;


I get logs only when I use this:



-A FORWARD -o vmbr0 -s 123.0.0.0/8 -m state -p tcp --dport 25 --state 
NEW -j LOG --log-level 7 --log-prefix "25port: "


... but this is not correct, because vmbr is the bridge.
How I can get traffic logs from virtual interfaces on port 25?







share|improve this question













I have KVM virtualization. I have over 60 interfaces:



vnet1-60 - virtual;
vmbr0 - bridge;
enp2s0f0 - PHYSOUT;


I need to know how many connection make each vnet interface.
I have a rule like:



iptables -A FORWARD -o vnet1 -m state -p tcp --dport 25 --state NEW -j 
LOG --log-level 7 --log-prefix "25port: "


... but no result. Same no result:



-A OUTPUT -o vnet*;
-A OUTPUT -o vnet55,vnet56;
-A OUTPUT -o enp2s0f0;


I get logs only when I use this:



-A FORWARD -o vmbr0 -s 123.0.0.0/8 -m state -p tcp --dport 25 --state 
NEW -j LOG --log-level 7 --log-prefix "25port: "


... but this is not correct, because vmbr is the bridge.
How I can get traffic logs from virtual interfaces on port 25?









share|improve this question












share|improve this question




share|improve this question








edited May 8 at 11:28









Rui F Ribeiro

34.5k1269113




34.5k1269113









asked May 8 at 9:38









Mr Vladimir

1




1











  • ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
    – A.B
    May 8 at 14:33
















  • ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
    – A.B
    May 8 at 14:33















ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
– A.B
May 8 at 14:33




ebtables.netfilter.org/misc/ebtables-faq.html#quiz3
– A.B
May 8 at 14:33










1 Answer
1






active

oldest

votes

















up vote
1
down vote













You need to load the br_netfilter module, and then enable iptables for bridged traffic, by means of



echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables


See "What's bridge-netfilter?"






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f442497%2fiptables-logging-connections-on-port-25-tcp%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    You need to load the br_netfilter module, and then enable iptables for bridged traffic, by means of



    echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables


    See "What's bridge-netfilter?"






    share|improve this answer

























      up vote
      1
      down vote













      You need to load the br_netfilter module, and then enable iptables for bridged traffic, by means of



      echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables


      See "What's bridge-netfilter?"






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        You need to load the br_netfilter module, and then enable iptables for bridged traffic, by means of



        echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables


        See "What's bridge-netfilter?"






        share|improve this answer













        You need to load the br_netfilter module, and then enable iptables for bridged traffic, by means of



        echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables


        See "What's bridge-netfilter?"







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered May 8 at 11:17









        Ralph Rönnquist

        2,36738




        2,36738






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442497%2fiptables-logging-connections-on-port-25-tcp%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay