Skip to content
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

Add a role to configure masquerading on hypervisor #1880

Closed

Conversation

hjensas
Copy link
Contributor

@hjensas hjensas commented Jun 14, 2024

Using nat type networks in libvirt causes firewall rules to be inserted by libvirt - these rules block traffic between libvirt networks. In some scenarios this is not desired, we want traffic between internal networks and still enable NAT (masquerading) of the traffic going to the external (internet/intranet).

This role's task is to insert these firewall rules to masquerade traffic where the src is a libvirt network and the dstis external (internet/intranet).

Also enable it in the reproducer. For example:

cifmw_masquerade_networks: true
cifmw_masquerade_external_source_ranges:
  - "{{ cifmw_networking_definition.networks.ironic.network }}"
  - "{{ cifmw_networking_definition.networks.ctlplane.network }}"

As a pull request owner and reviewers, I checked that:

  • Appropriate testing is done and actually running
  • Appropriate documentation exists and/or is up-to-date:
    • README in the role
    • Content of the docs/source is reflecting the changes

Copy link

Thanks for the PR! ❤️
I'm marking it as a draft, once your happy with it merging and the PR is passing CI, click the "Ready for review" button below.

@github-actions github-actions bot marked this pull request as draft June 14, 2024 15:53
@hjensas hjensas force-pushed the masquerade-external branch from a2a31f5 to e0007fa Compare June 14, 2024 16:58
@hjensas hjensas added the uni01alpha uni01alpha related patches label Jun 14, 2024
@hjensas hjensas marked this pull request as ready for review June 14, 2024 17:06
@hjensas hjensas force-pushed the masquerade-external branch from e0007fa to 0d22ed0 Compare June 14, 2024 17:12
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/23a2b39b84ed44ff8dd3d0d3542afb37

openstack-k8s-operators-content-provider FAILURE in 4m 51s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 13s
cifmw-pod-pre-commit FAILURE in 7m 49s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 52s
✔️ cifmw-molecule-libvirt_manager SUCCESS in 11m 58s
✔️ cifmw-molecule-masquerade_external SUCCESS in 4m 44s
✔️ cifmw-molecule-reproducer SUCCESS in 17m 48s

@hjensas hjensas force-pushed the masquerade-external branch from 0d22ed0 to 47bc92e Compare June 14, 2024 17:35
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/fc6f59ddd2c7410b9493686f54212bf2

openstack-k8s-operators-content-provider FAILURE in 4m 58s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 16s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 27s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 03s
✔️ cifmw-molecule-libvirt_manager SUCCESS in 15m 02s
✔️ cifmw-molecule-masquerade_external SUCCESS in 5m 46s
✔️ cifmw-molecule-reproducer SUCCESS in 18m 47s

@hjensas hjensas force-pushed the masquerade-external branch from 47bc92e to 7bd7e0c Compare June 15, 2024 10:18
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/a896b29f12934b60b71f28726db441f2

openstack-k8s-operators-content-provider FAILURE in 4m 42s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 28s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 39s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 30s
✔️ cifmw-molecule-libvirt_manager SUCCESS in 15m 02s
✔️ cifmw-molecule-masquerade_external SUCCESS in 5m 48s
✔️ cifmw-molecule-reproducer SUCCESS in 19m 48s

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/ce0ffd98617a48fe99633761841312d4

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 48m 21s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 19m 55s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 12m 27s
✔️ noop SUCCESS in 0s
cifmw-pod-ansible-test FAILURE in 6m 06s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 28s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 14s
✔️ cifmw-molecule-libvirt_manager SUCCESS in 15m 52s
✔️ cifmw-molecule-masquerade_external SUCCESS in 4m 45s
✔️ cifmw-molecule-reproducer SUCCESS in 18m 36s

@hjensas
Copy link
Contributor Author

hjensas commented Jun 18, 2024

recheck

@cjeanner
Copy link
Contributor

/approve

though I really don't like having two ways to manage the firewall :(.

Copy link
Contributor

openshift-ci bot commented Jun 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjeanner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Using *nat* type networks in libvirt causes firewall rules to be
inserted by libvirt - these rules block traffic between libvirt
networks. In some scenarios this is not desired, we want traffic between
internal networks and still enable NAT (masquerading) of the traffic
going to the external (internet/intranet).

This role's task is to insert these firewall rules to masquerade traffic
where the `src` is a libvirt network and the `dst`is external
(internet/intranet).

Also enable it in the reproducer. For example:
```yaml
cifmw_masquerade_networks: true
cifmw_masquerade_external_source_ranges:
  - "{{ cifmw_networking_definition.networks.ironic.network }}"
  - "{{ cifmw_networking_definition.networks.ctlplane.network }}"
```
@hjensas hjensas force-pushed the masquerade-external branch from 2235736 to 181224e Compare June 20, 2024 23:02
@hjensas hjensas marked this pull request as draft June 20, 2024 23:05
@hjensas
Copy link
Contributor Author

hjensas commented Jun 20, 2024

Moving this to draft - after reading https://discussion.fedoraproject.org/t/f41-change-proposal-libvirt-virtual-network-nftables-self-contained/120329, I think there may be a way to do this with firewalld.

@hjensas
Copy link
Contributor Author

hjensas commented Jun 24, 2024

Closing this, superseeded by #1928 which is using firewalld.

@hjensas hjensas closed this Jun 24, 2024
@hjensas hjensas deleted the masquerade-external branch June 28, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants