forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sonic-net#267 from oleksandrivantsiv/bluefield
Merge commit 'e66ae597f97c14b8d0fe3bb9e85c545b69081f1a' into bluefield
- Loading branch information
Showing
56 changed files
with
2,479 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
group:dhcp-server-ipv4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"Dhcp4": { | ||
"hooks-libraries": [ | ||
{ | ||
"library": "/usr/local/lib/kea/hooks/libdhcp_run_script.so", | ||
"parameters": { | ||
"name": "/etc/kea/lease_update.sh", | ||
"sync": false | ||
} | ||
} | ||
], | ||
"interfaces-config": { | ||
"interfaces": ["eth0"] | ||
}, | ||
"control-socket": { | ||
"socket-type": "unix", | ||
"socket-name": "/run/kea/kea4-ctrl-socket" | ||
}, | ||
"lease-database": { | ||
"type": "memfile", | ||
"persist": true, | ||
"name": "/tmp/kea-lease.csv", | ||
"lfc-interval": 3600 | ||
}, | ||
"subnet4": [], | ||
"loggers": [ | ||
{ | ||
"name": "kea-dhcp4", | ||
"output_options": [ | ||
{ | ||
"output": "/tmp/kea-dhcp.log", | ||
"pattern": "%-5p %m\n" | ||
} | ||
], | ||
"severity": "INFO", | ||
"debuglevel": 0 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{%- set default_lease_time = 900 -%} | ||
{ | ||
"Dhcp4": { | ||
"hooks-libraries": [ | ||
{ | ||
"library": "/usr/local/lib/kea/hooks/libdhcp_run_script.so", | ||
"parameters": { | ||
"name": "{{ lease_update_script_path }}", | ||
"sync": false | ||
} | ||
} | ||
], | ||
"interfaces-config": { | ||
"interfaces": [ | ||
"eth0" | ||
] | ||
}, | ||
"control-socket": { | ||
"socket-type": "unix", | ||
"socket-name": "/run/kea/kea4-ctrl-socket" | ||
}, | ||
"lease-database": { | ||
"type": "memfile", | ||
"persist": true, | ||
"name": "{{ lease_path }}", | ||
"lfc-interval": 3600 | ||
}, | ||
"subnet4": [ | ||
{%- set add_subnet_preceding_comma = { 'flag': False } %} | ||
{%- for subnet_info in subnets %} | ||
{%- if add_subnet_preceding_comma.flag -%},{%- endif -%} | ||
{%- set _dummy = add_subnet_preceding_comma.update({'flag': True}) %} | ||
{ | ||
"subnet": "{{ subnet_info["subnet"] }}", | ||
"pools": [ | ||
{%- set add_pool_preceding_comma = { 'flag': False } %} | ||
{%- for pool in subnet_info["pools"] %} | ||
{%- if add_pool_preceding_comma.flag -%},{%- endif -%} | ||
{%- set _dummy = add_pool_preceding_comma.update({'flag': True}) %} | ||
{ | ||
"pool": "{{ pool["range"] }}", | ||
"client-class": "{{ pool["client_class"] }}" | ||
} | ||
{%- endfor%} | ||
], | ||
"option-data": [ | ||
{ | ||
"name": "routers", | ||
"data": "{{ subnet_info["gateway"] if "gateway" in subnet_info else subnet_info["server_id"] }}" | ||
}, | ||
{ | ||
"name": "dhcp-server-identifier", | ||
"data": "{{ subnet_info["server_id"] }}" | ||
} | ||
], | ||
"valid-lifetime": {{ subnet_info["lease_time"] if "lease_time" in subnet_info else default_lease_time }}, | ||
"reservations": [] | ||
} | ||
{%- endfor %} | ||
], | ||
"loggers": [ | ||
{ | ||
"name": "kea-dhcp4", | ||
"output_options": [ | ||
{ | ||
"output": "/var/log/kea-dhcp.log", | ||
"pattern": "%-5p %m\n" | ||
} | ||
], | ||
"severity": "INFO", | ||
"debuglevel": 0 | ||
} | ||
]{%- if client_classes -%}, | ||
"client-classes": [ | ||
{%- set add_preceding_comma = { 'flag': False } %} | ||
{%- for class in client_classes %} | ||
{%- if add_preceding_comma.flag -%},{%- endif -%} | ||
{%- set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
{ | ||
"name": "{{ class["name"] }}", | ||
"test": "{{ class["condition"] }}" | ||
} | ||
{%- endfor %} | ||
] | ||
{%- endif %} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# This script would run once kea-dhcp4 lease change (defined in kea-dhcp4.conf), | ||
# it is to find running process dhcpservd.py, and send SIGUSR1 signal to this | ||
# process to inform it to update lease table in state_db (defined in dhcpservd.py) | ||
|
||
pid=`ps aux | grep 'dhcpservd' | grep -nv 'grep' | awk '{print $2}'` | ||
if [ -z "$pid" ]; then | ||
logger -p daemon.error Cannot find running dhcpservd.py. | ||
else | ||
# Send SIGUSR1 signal to dhcpservd.py | ||
kill -s 10 ${pid} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{# Generate port name-alias map for isc-dhcp-relay to parse. Each line contains one #} | ||
{# name-alias pair of the form "<name> <alias>" #} | ||
{% for port, config in PORT.items() %} | ||
{{- port }} {% if "alias" in config %}{{ config["alias"] }}{% else %}{{ port }}{% endif %} {{- "\n" -}} | ||
{% endfor -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# First some standard log files. Log by facility. | ||
# | ||
|
||
# Log all facilities to /var/log/syslog except cron, auth | ||
# and authpriv. They are noisy - log them to their own files | ||
*.*;cron,auth,authpriv.none -/var/log/syslog | ||
auth,authpriv.* /var/log/auth.log | ||
cron.* /var/log/cron.log | ||
|
||
# | ||
# Emergencies are sent to everybody logged in. | ||
# | ||
*.emerg :omusrmsg:* | ||
|
||
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, | ||
# you must invoke `xconsole' with the `-file' option: | ||
# | ||
# $ xconsole -file /dev/xconsole [...] | ||
# | ||
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably | ||
# busy site.. | ||
# | ||
#daemon.*;mail.*;\ | ||
# news.err;\ | ||
# *.=debug;*.=info;\ | ||
# *.=notice;*.=warn |/dev/xconsole |
Oops, something went wrong.