Page MenuHomeVyOS Platform

Add an option to disable IPv4 forwarding on specific interface only
Closed, ResolvedPublicFEATURE REQUEST

Description

There is an IPv4 and IPv6 option to disable forwarding on ALL interfaces set system ip disable-forwarding

There is also an optiontdo disable IPv6 forwarding on a particular interface set interfaces ethernet eth0 ipv6 disable-forwarding

but there is no such option for IPv4 interfaces and even multicast forwarding.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

syncer triaged this task as Wishlist priority.Sep 1 2018, 3:02 PM

How about this?

set system sysctl custom net.ipv4.conf.eth1.forwarding value '0'

sysctl

vyos@r2-roll# sudo sysctl -a | grep conf.eth1.forwarding
net.ipv4.conf.eth1.forwarding = 0
net.ipv6.conf.eth1.forwarding = 1
[edit]
vyos@r2-roll#

That would be a workaround only - see IPv6 syntax above. Using the refactored interface handling (T2653) makes this a low-hanging fruit.

PR https://github.com/vyos/vyos-1x/pull/576

vyos@r4-roll# set interfaces ethernet eth1 ip disable-forwarding 
[edit]
vyos@r4-roll# commit
[edit]
vyos@r4-roll# sudo sysctl -a | grep conf.eth1.forwarding
net.ipv4.conf.eth1.forwarding = 0
net.ipv6.conf.eth1.forwarding = 1
[edit]
vyos@r4-roll#
Viacheslav claimed this task.

Works as expected.

vyos@r4-roll# set interfaces ethernet eth1 ip disable-forwarding 
[edit]
vyos@r4-roll# commit
[edit]
vyos@r4-roll# sudo sysctl -a | grep "\.forwarding" | grep eth
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.eth1.forwarding = 0
net.ipv6.conf.eth0.forwarding = 1
net.ipv6.conf.eth1.forwarding = 1
[edit]
vyos@r4-roll#
dmbaturin renamed this task from Disable IPv4 forwarding on specific interface only to Add an option to disable IPv4 forwarding on specific interface only.Sep 3 2021, 12:10 PM
dmbaturin set Is it a breaking change? to Perfectly compatible.
dmbaturin set Issue type to Feature (new functionality).