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

iprules.sh into netcontrol #35

Draft
wants to merge 4 commits into
base: netcontrol
Choose a base branch
from
Draft

Conversation

awing-ding
Copy link

@awing-ding awing-ding commented Oct 20, 2024

Description

iprules.sh functions are converted to netcontrol functions

Checklist

  • I have tested the changes locally and they work as expected.
  • I have tested the responsiveness of the changes and they work as expected.
  • I have assigned the pull request to the appropriate reviewer(s).
  • I have added labels to the pull request, if necessary.

Related Issues

Closes #31

@awing-ding awing-ding added enhancement New feature or request good first issue Good for newcomers Priority: medium Netcontrol Netcontrol thing labels Oct 20, 2024
@awing-ding awing-ding self-assigned this Oct 20, 2024
@pixup1 pixup1 changed the base branch from dev to netcontrol October 20, 2024 13:20
@pixup1
Copy link
Member

pixup1 commented Oct 20, 2024

It would be better if iprules methods were in their own separate class (and file), as they don't really have anything to do with nftables

vpn (str): VPN routing table name
"""
try:
self._execute_nft_cmd(f"add rule insalan netcontrol-forward fwmark {mark} lookup {vpn}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iprules aren't managed byt nft but by ip rule (cf iprules.sh)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh okay, i clearly misunderstood the assignment 😂

@awing-ding
Copy link
Author

maybe the file should be elsewhere ?

@pixup1
Copy link
Member

pixup1 commented Oct 20, 2024

maybe the file should be elsewhere ?

Do you mean outside of netcontrol ? I think it's fine there

@InsaLan-Serveurs
Copy link

You also need to add the rules on api start and remove them on api stop. Use the lifetime() function from main.py for that (It's not up to date on your branch, do a git merge netcontrol)

@awing-ding awing-ding marked this pull request as ready for review October 23, 2024 11:13
@awing-ding
Copy link
Author

Ne marche pas (les commandes ip rules sont executés dans le conteneur)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Netcontrol Netcontrol thing Priority: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate ip rules into netcontrol
3 participants