Skip to content

RDKCOM-5618: RDKBNETWOR-76 Firewall rules to support wireguard tunnel. - #376

Open
pradeeptakdas wants to merge 1 commit into
rdkcentral:developfrom
pradeeptakdas:RDKBNETWOR-76
Open

RDKCOM-5618: RDKBNETWOR-76 Firewall rules to support wireguard tunnel.#376
pradeeptakdas wants to merge 1 commit into
rdkcentral:developfrom
pradeeptakdas:RDKBNETWOR-76

Conversation

@pradeeptakdas

Copy link
Copy Markdown

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

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>
Copilot AI review requested due to automatic review settings July 22, 2026 11:39
@pradeeptakdas
pradeeptakdas requested review from a team as code owners July 22, 2026 11:39
@github-actions

Copy link
Copy Markdown

📋 PR Format Reminder

  • Description missing:
    • Priority (P0 / P1 / P2)

Expected:

TICKET-123 : brief description

Reason for change: why
Test Procedure: how to verify
Risks: Low / Medium / High
Priority: P0 / P1 / P2

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_enabled and wireguard_port read from syscfg.
  • Adds iptables filter rules to ACCEPT traffic on wg0 and 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");
@pradeeptakdas pradeeptakdas changed the title RDKBNETWOR-76 : Firewall rules to support wireguard tunnel. RDKCOM-5618: RDKBNETWOR-76 Firewall rules to support wireguard tunnel. Jul 28, 2026
@AkhilaReddyK7 AkhilaReddyK7 added the community-contribution Contribution from community label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contribution from community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants