Skip to content

Commit 137b3da

Browse files
committed
systemvm: allow link-local ssh in the VR IPv6 firewall
The nftables ip6_firewall and ip6_acl tables created on VRs with IPv6 networking have an input hook chain with policy drop, which applies to all interfaces including the control NIC. Accept TCP 3922 between link-local addresses so sshd remains reachable on the IPv6 link-local address of the control interface. Restricting both saddr and daddr to fe80::/10 ensures no global address can reach sshd.
1 parent c1fa828 commit 137b3da

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

systemvm/debian/opt/cloud/bin/cs/CsNetfilter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ def add_ip6_chain(self, address_family, table, chain, hook, action):
232232
if hook == "input" or hook == "output":
233233
CsHelper.execute("nft add rule %s %s %s icmpv6 type { echo-request, echo-reply, \
234234
nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept" % (address_family, table, chain))
235+
if hook == "input":
236+
# sshd listens on the IPv6 link-local address of the control interface,
237+
# only allow this over link-local so no global address can reach it
238+
CsHelper.execute("nft add rule %s %s %s ip6 saddr fe80::/10 ip6 daddr fe80::/10 tcp dport 3922 accept" % (address_family, table, chain))
235239
if hook == "input" or hook == "forward":
236240
CsHelper.execute("nft add rule %s %s %s ct state established,related accept" % (address_family, table, chain))
237241

0 commit comments

Comments
 (0)