You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jciesiex NAT Bindings will be at CONFIG_DB only.
Based on NAT_BINDINGS table, NAT manager will add iptables NAT rules which are used for dynamic NAT translations and NAT_BINDINGS table is not pushed to APPL_DB. This is expected behavior only.
This commit fix the exception thrown by struct.pack when attempting to pack a unicode string.
The script ```fast-reboot-dump.py``` will throw an exception in python3 because ```struct.pack``` requires ```bytes``` for ```s```.
```
Traceback: Traceback (most recent call last):
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 299, in <module>
sonic-net#12 res = main()
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 292, in main
sonic-net#12 send_garp_nd(neighbor_entries, map_mac_ip_per_vlan)
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 221, in send_garp_nd
sonic-net#12 src_ip_addrs = {vlan_name:get_iface_ip_addr(vlan_name) for vlan_name,_,_ in neighbor_entries}
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 221, in <dictcomp>
sonic-net#12 src_ip_addrs = {vlan_name:get_iface_ip_addr(vlan_name) for vlan_name,_,_ in neighbor_entries}
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 195, in get_iface_ip_addr
sonic-net#12 return get_if(iff, SIOCGIFADDR)[20:24]
sonic-net#12 File "/usr/local/bin/fast-reboot-dump.py", line 185, in get_if
sonic-net#12 ifreq = ioctl(s, cmd, struct.pack("16s16x",iff))
sonic-net#12 struct.error: argument for 's' must be a bytes object
```
Signed-off-by: bingwang <bingwang@microsoft.com>
Steps to reproduce:
sudo config nat feature enable
echo '{"NAT_POOL": {"test_pool": {"nat_ip": "10.0.0.34","nat_port": "8000-9000"}},
"ACL_TABLE": {"test_acl": {"stage": "INGRESS","type": "L3","policy_desc": "test_policy","ports": ["Ethernet68"]}},
"NAT_BINDINGS": {"test_binding": {"access_list": "test_acl","nat_pool": "test_pool"}}}' > dynamic.json
sonic-cfggen -j dynamic.json --write-to-db
redis-dump -d 4 --pretty -k BINDING
redis-dump -d 0 --pretty -k BINDING
Observed behavior:
CONFIG_DB
{
"NAT_BINDINGS|test_binding": {
"type": "hash",
"value": {
"access_list": "test_acl",
"nat_pool": "test_pool"
}
}
}
APP_DB
no entries found
Expected behavior:
CONFIG_DB and APP_DB should be in sync
The text was updated successfully, but these errors were encountered: