Page MenuHomeVyOS Platform

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

Event Timeline

c-po created this task.Jul 21 2018, 3:22 PM
syncer triaged this task as Wishlist priority.Sep 1 2018, 3:02 PM
pasik added a subscriber: pasik.Oct 1 2018, 9:51 AM

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#
c-po added a comment.Fri, Oct 16, 8:42 PM

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

Viacheslav added a comment.EditedSat, Oct 17, 12:54 PM

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 closed this task as Resolved.Mon, Oct 19, 10:52 AM
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#