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

Route-based IPSEC / if_ipsec #2332

Closed
mimugmail opened this issue Apr 6, 2018 · 40 comments
Closed

Route-based IPSEC / if_ipsec #2332

mimugmail opened this issue Apr 6, 2018 · 40 comments
Assignees
Labels
feature Adding new functionality
Milestone

Comments

@mimugmail
Copy link
Member

Hi,

I'm targeting route-based IPSec and need some modifications.
Before I start digging into it I just want to ask if it's ok to:

  • make a new button in phase2: install policy yes/no
  • make auto = route to auto = start when button install routes in Advanced is NOT ticked

If yes I'd try this by mysef ..

@AdSchellevis
Copy link
Member

Hi Michael,

What do you mean with a new button in phase2?
Adding route-based would certainly be a good addition to have, I can help you review some code and suggest changes as long as the commits are in a manageable state (not too large).

Best,

Ad

@mimugmail
Copy link
Member Author

Sorry, I mean a checkbox ..

@AdSchellevis
Copy link
Member

clear, that makes sense :)

@mimugmail
Copy link
Member Author

Ok, I have a running setup. Quite easy but I need some additional commands like setting up a GRE/GIF tunnel. ATM .. I'm a bit underskilled for this.

Steps to reproduce:

  • Create a VPN with left und right subnet 0.0.0.0/0
  • In Advanced set Don't install routes
  • In P1 we need a checkbox "Install Policy", default checked which sets installpolicy = yes (which is already set to yes some where. Then uncheck it.
  • We need a if/else that when in Advanced Dont install routes is ticked, don't set auto = route, instead auto = start.
  • In P1 we new a new integer field for a "reqid" which sets reqid = XXX in con

This is fairly easy, now the tricky part:

  • For P1 we need a IF Install Policy = no && IF req != '' then
ifconfig ipsec0 create reqid <reqid>
ifconfig ipsec0 inet tunnel <left-ip> <right-ip> up
ifconfig ipsec0 inet <left-tunnel-ip>/32 <right-tunnel-ip>

Then you can create a new gateway with right-tunnel-ip and set as many routes as you wish.

Perhaps you could also create a new checkbox in P1 with "Enable Route-Based VPN" as a selector for IF bla

@mimugmail
Copy link
Member Author

If you are motivated you could create a new branch for this for testing ..

@fichtner fichtner added feature Adding new functionality help wanted Contributor missing / timeout labels Jun 21, 2018
@ccesario
Copy link

Aybe this reference canal help https://redmine.pfsense.org/issues/8544

@ccesario
Copy link

ccesario commented Sep 7, 2018

@mimugmail is the feature working into 18.7.2 version?

@ccesario
Copy link

Hi folks, is there any progress with this feature!?

@fichtner
Copy link
Member

Nope. All hands welcome.

@fichtner fichtner added this to the 19.7 milestone Dec 30, 2018
@fichtner fichtner removed the help wanted Contributor missing / timeout label Dec 30, 2018
@AdSchellevis AdSchellevis self-assigned this Mar 3, 2019
AdSchellevis added a commit that referenced this issue Mar 4, 2019
… for #2332

it would be good to refactor this code at some point, maybe wrap some of its logic in a class.
There's just too much logic in ipsec_configure_do at the moment
AdSchellevis added a commit that referenced this issue Mar 4, 2019
AdSchellevis added a commit that referenced this issue Mar 5, 2019
…hase1_src()

both get_interface_ipv6() and get_interface_ip() call get_failover_interface() which obscures the used parameters a lot (wan,lan,opt1 vs emX,emY,igbX)
AdSchellevis added a commit that referenced this issue Mar 5, 2019
- ipsec_configure_vti() synchronizes local configuration with current ipsec% interfaces
- ipsec_interfaces() automatically adds these interfaces to the interfaces list, so the user can add a gateway and routes
@AdSchellevis
Copy link
Member

AdSchellevis commented Mar 5, 2019

pkg install -f opnsense
opnsense-patch 9ccabe6 4c3d069 a045d3e d9dbcaf 8a55989 77743cf 139ef62 ee8fd03

AdSchellevis added a commit that referenced this issue Mar 5, 2019
…faces, but the same likely counts for all that's plugged in automatically. for #2332
@alexanderharm
Copy link

We still run it on 19.1.4 with the suggested patches and it works fine so far. We didn't dare to upgrade yet, though.

@jroehler23
Copy link

So, then don't do it. After this, it won't work anymore ;)

I have seen in some post that the reqid option in the IPSec settings was removed after 19.1.4. I think this is the major problem. In my logs I can see on both sides that IPSec is watching/working with different ids.

@fichtner
Copy link
Member

So, then don't do it. After this, it won't work anymore ;)

@jroehler23 If you're trying to be funny this may come off as rude to some who work on this code and use it successfully. I just want to point that out very friendly.

@fichtner
Copy link
Member

FWIW, it would be even better to open a support ticket with all the info of your case condensed, because a number of bugs were fixed in 19.1.4 - 19.1.6 and the feature is still relatively young and the issue here is already closed and there's not much sense reopening it as it refers to the initial implementation and things have changed since.

@jroehler23
Copy link

@fichtner I know this is a feature for milestone 19.7, so for me it seems to be beta. And normally in the course of development, comments like mine shouldn't be treated so seriously. But you are right, it was not in my mind to blame somebody for his "bad work" or something like this! I apologize if somebody took it the wrong way. It should just be a hint for others to be careful to update to 19.1.6, because it has taken me days to come to this point.

I will open a new ticket with my issue.

@fichtner
Copy link
Member

Thanks. No worries. Can only get better. :)

For reference the ticket is #3443

EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
… for opnsense#2332

it would be good to refactor this code at some point, maybe wrap some of its logic in a class.
There's just too much logic in ipsec_configure_do at the moment
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…ec_get_phase1_src()

both get_interface_ipv6() and get_interface_ip() call get_failover_interface() which obscures the used parameters a lot (wan,lan,opt1 vs emX,emY,igbX)
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…#2332

- ipsec_configure_vti() synchronizes local configuration with current ipsec% interfaces
- ipsec_interfaces() automatically adds these interfaces to the interfaces list, so the user can add a gateway and routes
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…faces, but the same likely counts for all that's plugged in automatically. for opnsense#2332
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
… for opnsense#2332

it would be good to refactor this code at some point, maybe wrap some of its logic in a class.
There's just too much logic in ipsec_configure_do at the moment
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…ec_get_phase1_src()

both get_interface_ipv6() and get_interface_ip() call get_failover_interface() which obscures the used parameters a lot (wan,lan,opt1 vs emX,emY,igbX)
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…#2332

- ipsec_configure_vti() synchronizes local configuration with current ipsec% interfaces
- ipsec_interfaces() automatically adds these interfaces to the interfaces list, so the user can add a gateway and routes
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
…faces, but the same likely counts for all that's plugged in automatically. for opnsense#2332
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

No branches or pull requests

6 participants