{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/SONiC/issues/273","repository_url":"https://api.github.com/repos/Azure/SONiC","labels_url":"https://api.github.com/repos/Azure/SONiC/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/Azure/SONiC/issues/273/comments","events_url":"https://api.github.com/repos/Azure/SONiC/issues/273/events","html_url":"https://github.com/Azure/SONiC/issues/273","id":374252689,"node_id":"MDU6SXNzdWUzNzQyNTI2ODk=","number":273,"title":"ValueError: invalid literal for int() with base 10: 'Vlan500' while adding / fetching VLAN interface in ACL table","user":{"login":"chaitanc","id":19969257,"node_id":"MDQ6VXNlcjE5OTY5MjU3","avatar_url":"https://avatars3.githubusercontent.com/u/19969257?v=4","gravatar_id":"","url":"https://api.github.com/users/chaitanc","html_url":"https://github.com/chaitanc","followers_url":"https://api.github.com/users/chaitanc/followers","following_url":"https://api.github.com/users/chaitanc/following{/other_user}","gists_url":"https://api.github.com/users/chaitanc/gists{/gist_id}","starred_url":"https://api.github.com/users/chaitanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaitanc/subscriptions","organizations_url":"https://api.github.com/users/chaitanc/orgs","repos_url":"https://api.github.com/users/chaitanc/repos","events_url":"https://api.github.com/users/chaitanc/events{/privacy}","received_events_url":"https://api.github.com/users/chaitanc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-26T07:02:54Z","updated_at":"2018-10-26T07:10:09Z","closed_at":null,"author_association":"NONE","body":"I tried to add VLAN to ACL as part of this, I used below config\r\n\r\n```\r\n\"ACL_TABLE\": {\r\n        \"1\": {\r\n            \"stage\": \"INGRESS\", \r\n            \"type\": \"L3\", \r\n            \"ports\": \"Vlan500\", \r\n            \"policy_desc\": \"Counter\"\r\n        }, \r\n        \"3\": {\r\n            \"stage\": \"INGRESS\", \r\n            \"type\": \"L3V6\", \r\n            \"ports\": \"Ethernet36\", \r\n            \"policy_desc\": \"L3V6 ACL\"\r\n        }\r\n },\r\n\"ACL_RULE\": {\r\n        \"1|1\": {\r\n            \"PRIORITY\": \"55\", \r\n            \"IP_TYPE\": \"ipv4any\", \r\n            \"SRC_IP\": \"10.10.0.26/32\", \r\n            \"PACKET_ACTION\": \"forward\", \r\n            \"DST_IP\": \"10.10.1.26/32\"\r\n        }, \r\n        \"3|1\": {\r\n            \"PRIORITY\": \"55\", \r\n            \"IP_TYPE\": \"ipv6any\", \r\n            \"SRC_IPV6\": \"2001:0:3238:DFE1:63:0:0:FEFB/128\", \r\n            \"PACKET_ACTION\": \"forward\", \r\n            \"DST_IPV6\": \"3001:0:3238:DFE1:63:0:0:FEFB/128\"\r\n        }\r\n    },\r\n```\r\n\r\nNow, did config reload and observed that  ACL rules are configured by verifying show acl rule.\r\n\r\n```\r\nroot@sonic-testing:/home/admin# show acl rule\r\nTable    Rule    Priority    Action    Match\r\n-------  ------  ----------  --------  ------------------------------------------\r\n1        1       55          forward   DST_IP: 10.10.1.26/32\r\n                                       IP_TYPE: ipv4any\r\n                                       SRC_IP: 10.10.0.26/32\r\n3        1       55          forward   DST_IPV6: 3001:0:3238:DFE1:63:0:0:FEFB/128\r\n                                       IP_TYPE: ipv6any\r\n                                       SRC_IPV6: 2001:0:3238:DFE1:63:0:0:FEFB/128\r\n```\r\n\r\nAfter that tried to verify the ACL table using show acl table, but observed error\r\n\r\n```\r\nroot@sonic-testing:/home/admin# show acl table\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/acl-loader\", line 9, in <module>\r\n    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'acl-loader')()\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 722, in __call__\r\n    return self.main(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 697, in main\r\n    rv = self.invoke(ctx)\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 1066, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 1066, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 895, in invoke\r\n    return ctx.invoke(self.callback, **ctx.params)\r\n  File \"/usr/lib/python2.7/dist-packages/click/core.py\", line 535, in invoke\r\n    return callback(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/click/decorators.py\", line 17, in new_func\r\n    return f(get_current_context(), *args, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/acl_loader/main.py\", line 616, in table\r\n    acl_loader.show_table(table_name)\r\n  File \"/usr/lib/python2.7/dist-packages/acl_loader/main.py\", line 502, in show_table\r\n    ports.sort(key=lambda name:int(name.strip('Ethernet')))\r\n  File \"/usr/lib/python2.7/dist-packages/acl_loader/main.py\", line 502, in <lambda>\r\n    ports.sort(key=lambda name:int(name.strip('Ethernet')))\r\nValueError: invalid literal for int() with base 10: 'Vlan500'\r\n```\r\n\r\nLet me know if my configuration is wrong. If my configuration is wrong, SONiC should not pass config reload with out error. As per the error, I understood the \"show acl table\" command parses the ports by stripping the \"Ethernet\" string and fetching the integer value from each port in the list. If VLAN is supported this needs to be changed.\r\n\r\nDid ACL with VLAN is supported ? If so, please resolve this issue.\r\n\r\nAttached is my config_db.json file used.\r\n[config_db_vlan_acl.txt](https://github.com/Azure/SONiC/files/2518088/config_db_vlan_acl.txt)\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/SONiC/issues/comments/433309700","html_url":"https://github.com/Azure/SONiC/issues/273#issuecomment-433309700","issue_url":"https://api.github.com/repos/Azure/SONiC/issues/273","id":433309700,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzMwOTcwMA==","user":{"login":"keboliu","id":19700240,"node_id":"MDQ6VXNlcjE5NzAwMjQw","avatar_url":"https://avatars0.githubusercontent.com/u/19700240?v=4","gravatar_id":"","url":"https://api.github.com/users/keboliu","html_url":"https://github.com/keboliu","followers_url":"https://api.github.com/users/keboliu/followers","following_url":"https://api.github.com/users/keboliu/following{/other_user}","gists_url":"https://api.github.com/users/keboliu/gists{/gist_id}","starred_url":"https://api.github.com/users/keboliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keboliu/subscriptions","organizations_url":"https://api.github.com/users/keboliu/orgs","repos_url":"https://api.github.com/users/keboliu/repos","events_url":"https://api.github.com/users/keboliu/events{/privacy}","received_events_url":"https://api.github.com/users/keboliu/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T07:10:09Z","updated_at":"2018-10-26T07:10:09Z","author_association":"COLLABORATOR","body":"AFAIK ACL not supported on VLAN, check the code here:\r\nhttps://github.com/Azure/sonic-swss/blob/master/orchagent/aclorch.cpp#L1077\r\nOnly support LAG and PORT."}}
{"actor":{"display_login":"keboliu"}}