Requirements

Ubuntu22, Docker

Install

# cd /opt
# git clone -b release https://github.com/netbox-community/netbox-docker nb --depth=1
# cd /opt/nb
# cp docker-compose.override.yml.example docker-compose.override.yml
# cat docker-compose.override.yml
services:
  netbox:
    ports:
      - "8000:8080"
    environment:
      CSRF_TRUSTED_ORIGINS: "http://netbox.mydomain.net https://netbox.mydomain.net"
...
# docker compose up -d
# docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser
Username: gdhong
Email address: gdhong@example.com
Password:
Password (again):
Superuser created successfully.
# docker ps -a
IMAGE                              PORTS                   NAMES
netboxcommunity/netbox:v4.0-2.9.0                          nb-netbox-worker-1
netboxcommunity/netbox:v4.0-2.9.0                          nb-netbox-housekeeping-1
netboxcommunity/netbox:v4.0-2.9.0  0.0.0.0:8000->8080/tcp  nb-netbox-1
postgres:16-alpine                 5432/tcp                nb-postgres-1
redis:7-alpine                     6379/tcp                nb-redis-1
redis:7-alpine                     6379/tcp                nb-redis-cache-1

Create API Token

웹브라우저로 다음 주소에 방문하여 로그인 후 API 키 생성

http://__DOCKER_HOST_IP__:8000/users/tokens/
https://__PROXY_WEBSERVER_DOMAIN__/users/tokens/

Sample Device Import

# apt install python3-pip
# cd /opt
# git clone https://github.com/netbox-community/Device-Type-Library-Import
# cd Device-Type-Library-Import
# pip3 install -r requirements.txt
# cp .env.example .env
# vi .env
NETBOX_URL=http://__DOCKER_HOST_IP__:8000
NETBOX_TOKEN=111222333444...
REPO_URL=https://github.com/netbox-community/devicetype-library.git
REPO_BRANCH=master
IGNORE_SSL_ERRORS=False
# ./nb-dt-import.py --vendors cisco,juniper,dell


  • 레이블 없음