Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGD2 Port triggering on eport == iport #193

Closed
andy-padavan opened this issue Mar 8, 2016 · 3 comments
Closed

IGD2 Port triggering on eport == iport #193

andy-padavan opened this issue Mar 8, 2016 · 3 comments

Comments

@andy-padavan
Copy link

Source thread:
http://miniupnp.tuxfamily.org/forum/viewtopic.php?t=1820&postdays=0&postorder=asc&start=0

After miniupnpd-1.9.20160222, each DNAT rule also will add MASQUERADE rule to MINIPNPD-POSTROUTING chain. This is big fat overhead, MASQUERADE rule needed for different ports only.

Please add condition to netfilter/iptcrdr.c, func "add_redirect_rule2":

#ifdef ENABLE_PORT_TRIGGERING
+       if (eport == iport)
+           return r;
        /* TODO : check if this should be done only with UDP */
        r = addmasqueraderule(proto, eport, iaddr, iport, rhost/*, ifname*/);
        if(r < 0) {
            syslog(LOG_NOTICE, "add_redirect_rule2(): addmasqueraderule returned %d", r);
        }
#endif /* ENABLE_PORT_TRIGGERING */
@miniupnp
Copy link
Owner

miniupnp commented Mar 8, 2016

indeed I see in http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO-6.html#ss6.3
that

The default behavior is to alter the connection as little as possible, within the constraints of the rule given by the user. This means we won't remap ports unless we have to.

@miniupnp
Copy link
Owner

miniupnp commented Mar 8, 2016

@andy-padavan have you an opinion on
TODO : check if this should be done only with UDP ?

@andy-padavan
Copy link
Author

Thanks.

MASQUERADE rule with is equal ports is really overhead, because POSTROUTING chain always have SNAT or MASQUERADE rule for entire LAN subnet. All outgoing traffic to WAN will be SNAT-ed.

have you an opinion on

Unfortunately I do not have Xbox One for testing. Theoretically, POSTROUTING rule with MASQUERADE ports is need only if there was no incoming traffic for DNAT-ed rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants