From 5995f83eded2169cb710070c89f067ac6e28f6af Mon Sep 17 00:00:00 2001 From: jack9603301 Date: Wed, 17 Mar 2021 02:20:59 +0800 Subject: nat66: T2518: Modify NAT ruleid acquisition method --- src/op_mode/show_nat_rules.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/op_mode') diff --git a/src/op_mode/show_nat_rules.py b/src/op_mode/show_nat_rules.py index 511c33610..a98fbef8c 100755 --- a/src/op_mode/show_nat_rules.py +++ b/src/op_mode/show_nat_rules.py @@ -41,9 +41,7 @@ if args.source or args.destination: for idx in range(0, len(data_json)): data = data_json[idx] comment = data['comment'] - rule = comment.replace('SRC-NAT-','') - rule = rule.replace('DST-NAT-','') - rule = rule.replace(' tcp_udp','') + rule = int(''.join(list(filter(str.isdigit, comment)))) chain = data['chain'] if not (args.source and chain == 'POSTROUTING') or (not args.source and chain == 'PREROUTING'): continue -- cgit v1.2.3