systemd / systemd/systemd

IPMasquerade source prefix options

Open
#12,011 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

network RFE 🎁
Dominant language
C
Stars
16.7k
Forks
4.7k
Avg merge
1d 6h
Merged PRs (30d)
140

Description

#8040

Is your feature request related to a problem? Please describe.
When using IPMasquerade, currently a source prefix is added to the rule, preventing it from being useful when other subnets are used, which is often the case when routing from other interfaces.

Describe the solution you'd like
Perhaps in addition to yes/no, other keywords for controlling this behavior. The default in my opinion should be to not specify a source address prefix at all, especially considering the current code assumes a single subnet. (No iteration for other addresses/prefixes).

Describe alternatives you've considered
I see 4 distinct desired behaviors:
no - obvious
yes - iptables -t nat -o oif -j MAQUERADE
internal - iptables -t nat -o oif -s 192.168.0.0/24 -j MASQUERADE
external - iptables -t nat -o oif ! -s 192.168.0.0/24 -j MASQUERADE

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file or test. Start by locating the IPMasquerade configuration handling and the generated iptables MASQUERADE rule, then compare the requested no, yes, internal, and external behaviors. Done means the selected option produces the corresponding source-prefix form, including no prefix for yes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
networking, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.