diff --git a/sshuttle/methods/nft.py b/sshuttle/methods/nft.py index cd28a5b..57572cd 100644 --- a/sshuttle/methods/nft.py +++ b/sshuttle/methods/nft.py @@ -40,8 +40,10 @@ class Method(BaseMethod): for _, swidth, sexclude, snet, fport, lport \ in sorted(subnets, key=subnet_weight, reverse=True): tcp_ports = ('ip', 'protocol', 'tcp') - if fport: - tcp_ports = tcp_ports + ('dport { %d-%d }' % (fport, lport)) + if fport and fport != lport: + tcp_ports = tcp_ports + ('tcp', 'dport', '{ %d-%d }' % (fport, lport)) + elif fport and fport == lport: + tcp_ports = tcp_ports + ('tcp', 'dport', '%d' % (fport)) if sexclude: _nft('add rule', chain, *(tcp_ports + (