Configuration
Customize NetScan's behavior through configuration files and environment variables.
Configuration File
NetScan looks for config at ~/.netscan/config.json:
{
"default_interface": "en0",
"scan_timeout": 5,
"scan_threads": 50,
"cache_ttl": 3600,
"log_level": "INFO",
"oui_update_interval": 604800,
"web_port": 8080,
"web_bind": "127.0.0.1"
}
Environment Variables
| Variable | Default | Description |
|---|---|---|
NETSCAN_HOME | ~/.netscan | Data directory |
NETSCAN_LOG_LEVEL | INFO | DEBUG, INFO, WARN, ERROR |
NETSCAN_TIMEOUT | 5 | Network timeout (seconds) |
NETSCAN_THREADS | auto | Concurrent scan threads |
NETSCAN_CACHE_TTL | 3600 | Cache lifetime (seconds) |
# Set environment variable
export NETSCAN_LOG_LEVEL=DEBUG
netscan -s
# Or inline
NETSCAN_TIMEOUT=10 netscan -s
Directory Structure
~/.netscan/
├── config.json # Configuration file
├── cache/ # Lookup cache
├── data/ # OUI database
├── logs/ # Log files
├── exports/ # Exported results
└── reports/ # Generated reports
OUI Database
# Update OUI database
netscan --update-oui
# Custom OUI source
export NETSCAN_OUI_URL="https://example.com/oui.txt"
netscan --update-oui
Logging
# Enable debug logging
netscan -s -v
NETSCAN_LOG_LEVEL=DEBUG netscan -s
# Log to file
netscan -s --log-file ~/netscan.log
Cache Settings
# Disable cache
netscan -l 00:50:56:C0:00:08 --no-cache
# Clear cache
rm -rf ~/.netscan/cache/*
# Set cache TTL (1 hour)
export NETSCAN_CACHE_TTL=3600
Network Defaults
{
"default_interface": "en0",
"default_target": "auto",
"scan_timeout": 5,
"ping_count": 1,
"arp_timeout": 2
}