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

Error when creating VPN tunnels with same Outside IP #14706

Closed
markkuleinio opened this issue Jan 5, 2024 · 1 comment · Fixed by #14711
Closed

Error when creating VPN tunnels with same Outside IP #14706

markkuleinio opened this issue Jan 5, 2024 · 1 comment · Fixed by #14711
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@markkuleinio
Copy link
Contributor

Deployment Type

Self-hosted

NetBox Version

v3.7.0

Python Version

3.9

Steps to Reproduce

Setup for test device:

  1. Create site MySite
  2. Create manufacturer Test
  3. Create device type TestModel
  4. Create device role VPN
  5. Create device TestDevice (using the attribute values above)
  6. For the device, create interfaces tunnel.[1-2] (type = virtual)
  7. For the device, create interface Internet (type = f.ex. 1000base-T)
  8. For the Internet interface, add IP address 123.123.123.123/32

Now the actual VPN tunnels:

  1. Create VPN tunnel Tunnel1:
    • encap = IPsec - Tunnel
    • first termination:
      • Role = Hub
      • Type = Device
      • Device = TestDevice
      • Interface = tunnel.1
      • Outside IP = 123.123.123.123/32
  2. Create another VPN tunnel Tunnel2:
    • encap = IPsec - Tunnel
    • first termination:
      • Role = Hub
      • Type = Device
      • Device = TestDevice
      • Interface = tunnel.2
      • Outside IP = 123.123.123.123/32

Expected Behavior

Both tunnels and terminations are created successfully, as they will both terminate on the same Outside IP. That is the usual way of using several tunnels on the same device.

Observed Behavior

When pressing the Create button for the second tunnel:

"
Server Error

There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'django.db.utils.IntegrityError'>

duplicate key value violates unique constraint "vpn_tunneltermination_outside_ip_id_key"
DETAIL: Key (outside_ip_id)=(14) already exists.

Python version: 3.9.2
NetBox version: 3.7.0
Plugins: None installed
"

@markkuleinio markkuleinio added the type: bug A confirmed report of unexpected behavior in the application label Jan 5, 2024
@markkuleinio
Copy link
Contributor Author

markkuleinio commented Jan 5, 2024

By the way, the error is output differently if I just create Tunnel2 first without terminations, and then go to Tunnel Terminations to create one:

image

= there is no Server Error but an error message "Tunnel termination with this Outside ip already exists" in the form.

Just putting this out here if someone tests the issue this way.

@jeremystretch jeremystretch self-assigned this Jan 5, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Jan 5, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants