Skip to content

WIP: Automatic Port Forwarding [core-admin] #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed first/last
  • Loading branch information
Giulio committed Aug 13, 2021
commit 8a4ed7f780c073eaea36f247a99cf52fd5f7bf6a
1 change: 0 additions & 1 deletion qubes/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ def qdb_forward_entries(self, addr_family=None):
exclude_srctype = 'src4' if addr_family == 6 else 'src6'
for ruleno, rule in zip(itertools.count(),
filter(lambda x: (x.action == "forward"), self.rules)):

if rule.expire and rule.expire.expired:
continue
# exclude rules for another address family
Expand Down
7 changes: 2 additions & 5 deletions qubes/vm/mix/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,15 @@ def reload_firewall_for_vm(self, vm):
if forwardtype == "internal":
base_dir = '/qubes-firewall-forward/{}/{}/'.format(vm.name, ip)
self.untrusted_qdb.write(base_dir + key, value)
self.untrusted_qdb.write(base_dir + key + '/first', '1')
self.untrusted_qdb.write(base_dir + key + '/last', '1')
self.untrusted_qdb.write(base_dir + '/last', '1')
self.untrusted_qdb.write(base_dir[:-1], '')
elif forwardtype == "external":
current_ip = ip
for i, netvm in enumerate(netpath):
base_dir = '/qubes-firewall-forward/{}/{}/'.format(vm.name, current_ip)
netvm.untrusted_qdb.write(base_dir + key, value)
if i == 0:
netvm.untrusted_qdb.write(base_dir + key + '/first', '1')
if i == len(netpath)-1:
netvm.untrusted_qdb.write(base_dir + key + '/last', '1')
netvm.untrusted_qdb.write(base_dir + '/last', '1')
current_ip = netvm.ip
self.untrusted_qdb.write(base_dir[:-1], '')
else:
Expand Down