Skip to content

Commit 4c52aef

Browse files
committed
openvmm: allow forwarded SSH from non-default host NIC
1 parent 51005fa commit 4c52aef

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • lisa/sut_orchestrator/openvmm

lisa/sut_orchestrator/openvmm/node.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,12 +1527,12 @@ def _enable_ssh_forwarding(
15271527
"-m state --state RELATED,ESTABLISHED -j ACCEPT"
15281528
),
15291529
(
1530-
"iptables -C FORWARD -i "
1531-
f"{shlex.quote(forwarding_interface)} -o {shlex.quote(host_interface)} "
1530+
"iptables -C FORWARD ! -i "
1531+
f"{shlex.quote(host_interface)} -o {shlex.quote(host_interface)} "
15321532
f"-p tcp -d {guest_address} --dport {guest_port} -j ACCEPT "
15331533
"|| "
1534-
"iptables -I FORWARD -i "
1535-
f"{shlex.quote(forwarding_interface)} -o {shlex.quote(host_interface)} "
1534+
"iptables -I FORWARD ! -i "
1535+
f"{shlex.quote(host_interface)} -o {shlex.quote(host_interface)} "
15361536
f"-p tcp -d {guest_address} --dport {guest_port} -j ACCEPT"
15371537
),
15381538
(
@@ -1634,8 +1634,8 @@ def _disable_ssh_forwarding_context(
16341634
"-m state --state RELATED,ESTABLISHED -j ACCEPT || true"
16351635
),
16361636
(
1637-
"iptables -D FORWARD -i "
1638-
f"{shlex.quote(forwarding_interface)} -o {shlex.quote(host_interface)} "
1637+
"iptables -D FORWARD ! -i "
1638+
f"{shlex.quote(host_interface)} -o {shlex.quote(host_interface)} "
16391639
f"-p tcp -d {guest_address} --dport {guest_port} -j ACCEPT || true"
16401640
),
16411641
(

0 commit comments

Comments
 (0)