-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[config/acl] Get ACL config from DHCP and load it in swss container #432
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,18 @@ function start_app { | |
done | ||
} | ||
|
||
function config_acl { | ||
if [ -f "/etc/sonic/acl.json" ]; then | ||
mkdir -p /etc/swss/config.d/acl | ||
rm -rf /etc/swss/config.d/acl/* | ||
translate_acl -m /etc/sonic/minigraph.xml -o /etc/swss/config.d/acl /etc/sonic/acl.json | ||
for filename in /etc/swss/config.d/acl/*.json; do | ||
[ -e "$filename" ] || break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this line? #ByDesign There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is no file in |
||
swssconfig $filename | ||
done | ||
fi | ||
} | ||
|
||
function clean_up { | ||
pkill -9 orchagent | ||
pkill -9 portsyncd | ||
|
@@ -60,6 +72,7 @@ while true; do | |
result=`echo -en "SELECT 1\nHLEN HIDDEN" | redis-cli | sed -n 2p` | ||
if [ "$result" != "0" ]; then | ||
start_app | ||
config_acl | ||
read | ||
fi | ||
sleep 1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,12 @@ | |
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; | ||
option snmp-community code 224 = text; | ||
option minigraph-url code 225 = text; | ||
option acl-url code 226 = text; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you update the doc https://github.com/Azure/SONiC/wiki/Configuration-and-Minigraph accordingly #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. #Resolved |
||
|
||
send host-name = gethostname(); | ||
request subnet-mask, broadcast-address, time-offset, routers, | ||
domain-name, domain-name-servers, domain-search, host-name, | ||
dhcp6.name-servers, dhcp6.domain-search, | ||
netbios-name-servers, netbios-scope, interface-mtu, | ||
rfc3442-classless-static-routes, ntp-servers, snmp-community, minigraph-url; | ||
rfc3442-classless-static-routes, ntp-servers, snmp-community, minigraph-url, acl-url; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer to have the acl configuration generation part to be there in config.sh script. we could keep the intermediate acl json files stored here. it doesn't hurt and could be used as references.
as a separate suggestion that we could do it later, i think we could just put the configurations that we need into the config.d folder, copying them from /usr/share/sonic/... folder. in sonic-swss repository, we only have samples there. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently don't have a config.sh for swss docker and I don't see much necessity to add one just for acl. We can split start.sh to config.sh and start.sh later if we added more feature and configuration logic became more complicated. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. #Closed