RDKCOM-5618: RDKBNETWOR-76 Firewall rules to support wireguard tunnel. - #376
Open
pradeeptakdas wants to merge 1 commit into
Open
RDKCOM-5618: RDKBNETWOR-76 Firewall rules to support wireguard tunnel.#376pradeeptakdas wants to merge 1 commit into
pradeeptakdas wants to merge 1 commit into
Conversation
Reason for change: Firewall rules to forward the traffic and the port for wireguard communications are added. Test Procedure: Check the firewall rules with the respective traffic flow once the connection is established. Testing Done : Results are captured in RDKBNETWOR-76 Risks: None. Change-Id: I13be7e2c1b945778b611c0c19997886fb7705065 Signed-off-by: Kavita Vakkund <kavita.vakkund@telekom-digital.com>
|
📋 PR Format Reminder
Expected: |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds WireGuard-related firewall configuration so the device can accept WireGuard UDP traffic and permit traffic to traverse the wg0 tunnel interface.
Changes:
- Introduces new global config values for
wireguard_enabledandwireguard_portread fromsyscfg. - Adds iptables filter rules to ACCEPT traffic on
wg0and to open the WireGuard UDP listening port on the WAN interface.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3102
to
3106
| wireguard_port[0] = '\0'; | ||
| rc = syscfg_get(NULL, "Wireguard_Port", wireguard_port, sizeof(wireguard_port)); | ||
| if (0 != rc || '\0' == wireguard_port[0]) { | ||
| snprintf(wireguard_port, sizeof(wireguard_port), "53280"); | ||
| } |
Comment on lines
+12447
to
+12450
| fprintf(filter_fp, "-A INPUT -i wg0 -j ACCEPT\n"); | ||
| fprintf(filter_fp, "-A OUTPUT -o wg0 -j ACCEPT\n"); | ||
| fprintf(filter_fp, "-A INPUT -i erouter0 -p udp --dport %s -j ACCEPT\n",wireguard_port); | ||
| } |
Comment on lines
+12444
to
+12448
| if(wireguard_enabled[0] == '1') { | ||
| fprintf(filter_fp, "-A FORWARD -o wg0 -j ACCEPT\n"); | ||
| fprintf(filter_fp, "-A FORWARD -i wg0 -j ACCEPT\n"); | ||
| fprintf(filter_fp, "-A INPUT -i wg0 -j ACCEPT\n"); | ||
| fprintf(filter_fp, "-A OUTPUT -o wg0 -j ACCEPT\n"); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: Firewall rules to forward the traffic and the port for wireguard communications are added.
Test Procedure: Check the firewall rules with the respective traffic flow once the connection is established.
Testing Done : Results are captured in RDKBNETWOR-76
Risks: None.
Signed-off-by: Kavita Vakkund kavita.vakkund@telekom-digital.com
Change-Id: I13be7e2c1b945778b611c0c19997886fb7705065