access to Web Interface using the IPv6 address instead of of DNS fail to go to the Netbox web page #537

Closed
opened 2025-12-29 16:23:00 +01:00 by adam · 1 comment
Owner

Originally created by @ricardo-rod on GitHub (Nov 13, 2016).

Hello, I want to told you that I really do not think that this is a problem with the Netbox software, I think it is a problem of the gunicorn,

I will begin explaining my issue, I am testing the IPv6/IPv4 only connectivity without the use of the DNS server at all to resolve the names.

So I setup everything to work with the IPv6 module and everything is working fine in the IPv4 world, I made a simple test.

So I was working with IPv6 link local address, and tried to go to http://[fe80::20c:29ff:fe45:9d8c]/ and later to test if the problem was with the link local address, I added a global unicast IPv6 address into the Linux interface and to my virtual machine adapter and I assure myself to stop the firewall of the physical machine and the VM too and disabled selinux. But I was not able to go the Netbox web page instead I was going to the NGNX default index.html page.

I tried the IPv4 address http://192.168.220.6/ and the browser went to the Netbox page, the IPv6 I was getting few errors get rid of the error after doing a few mods into the files. , but if I do an DNS query, adding to the /etc/hosts in the OS windows.

#Windows /etc/hosts
2016:fade::22 ipam.lab.local

I am using centos 7.0.
Linux ipam 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

cd /opt/netbox/netbox/netbox
vim configuration.py

ALLOWED_HOSTS = ['fe80::20c:29ff:fe45:9d8c', '2016:fade::22', '192.168.220.6', 'ipam.lab.local']`

and to the file located in /etc/nginx/sites-available/netbox, put some tiher parameters missing fro the guide.

'server {
listen 80;
listen [::]:80;
server_name ipam.lab.local 192.168.220.6 2016:fade::22 fe80::20c:29ff:fe45:9d8c;

access_log off;

location /static/ {
    alias /opt/netbox/netbox/static/;
}

location / {
proxy_pass http://127.0.0.1:8001;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}

}
`
I made some tests, That I will explain now.

To the file /etc/nginx/sites-available/netbox
I added the listen [::]:80; and changed the server_name to see the importance

`#server_name 192.168.220.6;
#server_name 192.168.220.6 fe80::20c:29ff:fe45:9d8c 2016:fade::22 ipam.lab.local;
#server_name ipam.lab.local 192.168.220.6;
server_name ipam.lab.local 2016:fade::22 fe80::20c:29ff:fe45:9d8 192.168.220.6;
#server_name 2016:fade::22;
#server_name 2016:fade::22 fe80::20c:29ff:fe45:9d8c ipam.lab.local 192.168.220.6;

location / {
    #proxy_pass http://127.0.0.1:8001; 
	#proxy_pass http://192.168.220.6:8001;
	#proxy_pass http://localhost:8001;
	proxy_pass http://[::1]:8001; 
	#proxy_pass http://[2016:fade::22]:8001; 

`

IPv6 go go to nginx default but dns IPv6 http://ipam.lab.local/ or IPv4 address http://192.168.220.6/
go to Bad Request (400)

Paramenter combination
server_name 2016:fade::22 fe80::20c:29ff:fe45:9d8c ipam.lab.local 192.168.220.6;
proxy_pass http://localhost:8001;
proxy_pass http://127.0.0.1:8001;

If i use in the gunicorn file /opt/netbox-1.7.0/gunicorn_config.py
bind = '127.0.0.1:8001'

502 Bad Gateway in the web browser using dns IPv6 http://ipam.lab.local/ or IPv4 address http://192.168.220.6/
the http://[2016:fade::22]/ is still going to nginx HTTP server default index.html

So I made all the posible combinations to see if one works but nothing to be happy.

Then I add the localhost and IPv6 loopback to the bind, uncommented the IPv6 bind and commented the IPV4 and then it works using IPv6 DNS and IPv4 address but the IPv6 link local or global is still going to nginx HTTP server default index.html
only

[root@ipam ~]# vim /opt/netbox/gunicorn_config.py

command = '/usr/bin/gunicorn'
pythonpath = '/opt/netbox/netbox'
#bind = '127.0.0.1:8001'
bind = '[::1]:8001'
#bind = 'localhost:8001'
workers = 3
user = 'nginx'

So to by default listen to IPv4 and IPv6
proxy_pass http://[::1]:8001;

and the gunicorn_config.py bind IPv4 and IPv6 must be:
bind = '[::1]:8001'

the problem is that the directly Ipv6 addresses

http://[2016:fade::22]/
or
http://[fe80::20c:29ff:fe45:9d8c]/

Is not taking the proxy to the netbox, so what or where is the problem?

For me, it is like the netbox file with the nginx is not reading or taking in consideration the IPv6 addresses. After I discovered if I chooce Ipv6 address first and the the name and the IPv4 it gives me the Bad Request (400).

A developer friend told me that HTTP1.1 does not support IPv6 natively only HTTP2.x so he recommend me to use the DNS host to test.
./manage.py runserver [::0]:8000 --insecure.

Originally created by @ricardo-rod on GitHub (Nov 13, 2016). Hello, I want to told you that I really do not think that this is a problem with the Netbox software, I think it is a problem of the gunicorn, I will begin explaining my issue, I am testing the IPv6/IPv4 only connectivity without the use of the DNS server at all to resolve the names. So I setup everything to work with the IPv6 module and everything is working fine in the IPv4 world, I made a simple test. So I was working with IPv6 link local address, and tried to go to http://[fe80::20c:29ff:fe45:9d8c]/ and later to test if the problem was with the link local address, I added a global unicast IPv6 address into the Linux interface and to my virtual machine adapter and I assure myself to stop the firewall of the physical machine and the VM too and disabled selinux. But I was not able to go the Netbox web page instead I was going to the NGNX default index.html page. I tried the IPv4 address http://192.168.220.6/ and the browser went to the Netbox page, the IPv6 I was getting few errors get rid of the error after doing a few mods into the files. , but if I do an DNS query, adding to the /etc/hosts in the OS windows. #Windows /etc/hosts 2016:fade::22 ipam.lab.local I am using centos 7.0. Linux ipam 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux cd /opt/netbox/netbox/netbox vim configuration.py ALLOWED_HOSTS = ['fe80::20c:29ff:fe45:9d8c', '2016:fade::22', '192.168.220.6', 'ipam.lab.local']` and to the file located in /etc/nginx/sites-available/netbox, put some tiher parameters missing fro the guide. 'server { listen 80; listen [::]:80; server_name ipam.lab.local 192.168.220.6 2016:fade::22 fe80::20c:29ff:fe45:9d8c; access_log off; location /static/ { alias /opt/netbox/netbox/static/; } location / { proxy_pass http://127.0.0.1:8001; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; } } ` I made some tests, That I will explain now. To the file /etc/nginx/sites-available/netbox I added the listen [::]:80; and changed the server_name to see the importance `#server_name 192.168.220.6; #server_name 192.168.220.6 fe80::20c:29ff:fe45:9d8c 2016:fade::22 ipam.lab.local; #server_name ipam.lab.local 192.168.220.6; server_name ipam.lab.local 2016:fade::22 fe80::20c:29ff:fe45:9d8 192.168.220.6; #server_name 2016:fade::22; #server_name 2016:fade::22 fe80::20c:29ff:fe45:9d8c ipam.lab.local 192.168.220.6; location / { #proxy_pass http://127.0.0.1:8001; #proxy_pass http://192.168.220.6:8001; #proxy_pass http://localhost:8001; proxy_pass http://[::1]:8001; #proxy_pass http://[2016:fade::22]:8001; ` IPv6 go go to nginx default but dns IPv6 http://ipam.lab.local/ or IPv4 address http://192.168.220.6/ go to Bad Request (400) Paramenter combination server_name 2016:fade::22 fe80::20c:29ff:fe45:9d8c ipam.lab.local 192.168.220.6; proxy_pass http://localhost:8001; proxy_pass http://127.0.0.1:8001; If i use in the gunicorn file /opt/netbox-1.7.0/gunicorn_config.py bind = '127.0.0.1:8001' 502 Bad Gateway in the web browser using dns IPv6 http://ipam.lab.local/ or IPv4 address http://192.168.220.6/ the http://[2016:fade::22]/ is still going to nginx HTTP server default index.html So I made all the posible combinations to see if one works but nothing to be happy. Then I add the localhost and IPv6 loopback to the bind, uncommented the IPv6 bind and commented the IPV4 and then it works using IPv6 DNS and IPv4 address but the IPv6 link local or global is still going to nginx HTTP server default index.html only [root@ipam ~]# vim /opt/netbox/gunicorn_config.py command = '/usr/bin/gunicorn' pythonpath = '/opt/netbox/netbox' #bind = '127.0.0.1:8001' bind = '[::1]:8001' #bind = 'localhost:8001' workers = 3 user = 'nginx' So to by default listen to IPv4 and IPv6 proxy_pass http://[::1]:8001; and the gunicorn_config.py bind IPv4 and IPv6 must be: bind = '[::1]:8001' the problem is that the directly Ipv6 addresses http://[2016:fade::22]/ or http://[fe80::20c:29ff:fe45:9d8c]/ Is not taking the proxy to the netbox, so what or where is the problem? For me, it is like the netbox file with the nginx is not reading or taking in consideration the IPv6 addresses. After I discovered if I chooce Ipv6 address first and the the name and the IPv4 it gives me the Bad Request (400). A developer friend told me that HTTP1.1 does not support IPv6 natively only HTTP2.x so he recommend me to use the DNS host to test. ./manage.py runserver [::0]:8000 --insecure.
adam closed this issue 2025-12-29 16:23:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 14, 2016):

Could you re-post this on the mailing list please? GitHub issues are primarily for bug reports and feature requests. Thanks.

@jeremystretch commented on GitHub (Nov 14, 2016): Could you re-post this on the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) please? GitHub issues are primarily for bug reports and feature requests. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#537