Option - Системные опции
Системные опции VyOS позволяют настроить поведение системы, оптимизировать производительность, управлять HTTP/SSH клиентами и изменять различные system-wide параметры для адаптации роутера под специфические требования.
Обзор
Категории системных опций
Performance Options:
- Throughput optimization для высокой пропускной способности
- Latency optimization для низких задержек
- Kernel tweaks для специфических workloads
Network Client Options:
- HTTP client source address и interface
- SSH client source address и interface
- Контроль исходящих соединений
Hardware Options:
- Keyboard layout для консоли
- Startup beep enable/disable
- Root partition auto-resize
System Behavior:
- CTRL-ALT-DELETE behavior (ignore/reboot/poweroff)
- Reboot on kernel panic
- Reboot on upgrade failure
Kernel Options:
- CPU mitigations disable
- Power saving disable
- AMD P-State driver mode
- Quiet boot mode
Применение в облачных средах
Yandex Cloud:
- Performance tuning для compute-optimized instances
- HTTP client source для metadata service
- Auto-resize для disk expansion
VK Cloud:
- Latency optimization для high-performance workloads
- SSH client source для management networks
- Kernel optimizations для specific instance types
Требования к изменениям
Большинство опций требуют:
- Configuration commit
- System reboot для kernel и performance опций
- Проверка после применения
Performance Options
Performance Profiles
VyOS предоставляет два performance профиля для оптимизации network stack:
Throughput Profile:
# Оптимизация для максимальной пропускной способности
set system option performance throughput
commitНазначение:
- Максимизация network throughput
- Оптимальные buffer sizes для bulk data transfer
- Подходит для file servers, backup, content delivery
Изменяемые параметры:
- Увеличенные TCP/UDP buffers
- Aggressive TCP window scaling
- Optimized interrupt coalescing
Latency Profile:
# Оптимизация для минимальных задержек
set system option performance latency
commitНазначение:
- Минимизация network latency
- Быстрая packet processing
- Подходит для VoIP, gaming, real-time applications
Изменяемые параметры:
- Reduced buffer sizes
- Faster interrupt processing
- Lower latency network stack tuning
Применение Performance Profiles
После применения требуется reboot:
set system option performance throughput
commit
save
# Reboot system
reboot nowПроверка активного профиля
# Проверить текущую конфигурацию
show configuration system option performance
# System network parameters
show system kernel-parameters | grep netDefault Performance Mode
Если performance profile не задан:
- Используется balanced mode
- Default Linux kernel network stack settings
- Подходит для general purpose workloads
HTTP Client Configuration
HTTP Client Source Address
Настройка source address для исходящих HTTP соединений:
# Использовать specific IP для HTTP requests
set system option http-client source-address 10.0.1.1
commitПрименение:
- Контроль source IP для HTTP traffic
- Routing specific для management connections
- Compliance с firewall rules
HTTP Client Source Interface
Настройка source interface для исходящих HTTP соединений:
# Использовать specific interface для HTTP requests
set system option http-client source-interface eth0
commitПрименение:
- Force HTTP через specific interface
- Management traffic isolation
- Multi-homed routing control
Комбинированная конфигурация
# Source interface и address
set system option http-client source-interface eth1
set system option http-client source-address 192.168.1.1
commitUse Cases для HTTP Client Options
Yandex Cloud Metadata Service:
# Ensure HTTP metadata requests из правильного interface
set system option http-client source-interface eth0
set system option http-client source-address 10.0.0.10
commitVK Cloud Management Network:
# Isolate management HTTP traffic
set system option http-client source-interface eth2
set system option http-client source-address 172.16.1.1
commitMulti-WAN с HTTP источником:
# Force HTTP updates через specific WAN
set system option http-client source-interface eth1
set system option http-client source-address 203.0.113.1
commitSSH Client Configuration
SSH Client Source Address
Настройка source address для исходящих SSH соединений:
# Использовать specific IP для SSH connections
set system option ssh-client source-address 10.0.1.1
commitПрименение:
- Контроль source IP для SSH traffic
- Firewall rules на remote servers
- Audit и logging
SSH Client Source Interface
Настройка source interface для исходящих SSH соединений:
# Использовать specific interface для SSH
set system option ssh-client source-interface eth1
commitПрименение:
- Force SSH через management interface
- Network isolation
- Multi-homed routing
Пример: SSH через Management Network
# SSH только через management interface
set system option ssh-client source-interface eth2
set system option ssh-client source-address 192.168.100.1
commit
# Проверка
ssh admin@remote-server
# Connection будет из 192.168.100.1Keyboard Layout
Изменение раскладки клавиатуры
Keyboard layout влияет только на system console (не SSH):
# Доступные layouts: us, fr, de, fi, no, dk
set system option keyboard-layout us
commitSupported Layouts:
us- US English (default)fr- Frenchde- Germanfi- Finnishno- Norwegiandk- Danish
Применение
Изменение требует reboot:
set system option keyboard-layout de
commit
save
reboot nowПроверка текущей раскладки
# Конфигурация
show configuration system option keyboard-layout
# Console keyboard settings
localectl statusПримечания
- Keyboard layout влияет только на physical console
- SSH sessions используют client keyboard layout
- Serial console также использует configured layout
Startup Beep
Enable/Disable System Beep
Управление звуковым сигналом при загрузке системы:
Disable Beep (рекомендуется для datacenter):
# Отключить startup beep
set system option startup-beep
commit
saveEnable Beep (default behavior):
# Включить startup beep (удалить опцию)
delete system option startup-beep
commit
saveПрименение
- Изменение требует reboot
- Полезно в datacenter для снижения шума
- Diagnostic tool для troubleshooting загрузки
Проверка
# Текущая конфигурация
show configuration system option startup-beep
# После reboot system beeps или нетCTRL-ALT-DELETE Behavior
Настройка поведения CTRL-ALT-DELETE
Control+Alt+Delete на console keyboard может быть настроен:
Ignore (рекомендуется для production):
# Игнорировать CTRL-ALT-DELETE
set system option ctrl-alt-delete ignore
commit
saveReboot:
# Reboot при CTRL-ALT-DELETE
set system option ctrl-alt-delete reboot
commit
savePoweroff:
# Poweroff при CTRL-ALT-DELETE
set system option ctrl-alt-delete poweroff
commit
saveDefault (без конфигурации):
# Использовать system default (обычно ignore)
delete system option ctrl-alt-delete
commitБезопасность
Production Environment:
# Всегда ignore для предотвращения accidental reboots
set system option ctrl-alt-delete ignore
commitDevelopment/Lab:
# Reboot для удобства
set system option ctrl-alt-delete reboot
commitПроверка
# Текущая конфигурация
show configuration system option ctrl-alt-delete
# Systemd configuration
systemctl status ctrl-alt-del.targetReboot on Panic
Automatic Reboot при Kernel Panic
Настройка автоматической перезагрузки при kernel panic:
Enable Reboot on Panic:
# Автоматический reboot при kernel panic
set system option reboot-on-panic
commit
saveDisable (default):
# Не reboot при panic (для debugging)
delete system option reboot-on-panic
commitПрименение
Production Servers:
# Enable для автоматического recovery
set system option reboot-on-panic
commitDevelopment/Debugging:
# Disable для анализа panic
delete system option reboot-on-panic
commitKernel Panic Timeout
Timeout настраивается через sysctl:
# Set panic timeout (секунды перед reboot)
set system sysctl parameter kernel.panic value 10
commitПроверка
# VyOS конфигурация
show configuration system option reboot-on-panic
# Kernel parameter
cat /proc/sys/kernel/panicReboot on Upgrade Failure
Automatic Reboot при Failed Upgrade
Rollback и reboot при неудачном system upgrade:
Enable с Timeout:
# Reboot после 5 минут если upgrade failed
set system option reboot-on-upgrade-failure 300
commit
saveDisable (default):
delete system option reboot-on-upgrade-failure
commitTimeout Values
# 5 минут (300 секунд)
set system option reboot-on-upgrade-failure 300
# 10 минут
set system option reboot-on-upgrade-failure 600
# 1 минута (minimum for testing)
set system option reboot-on-upgrade-failure 60
commitUse Case
Remote Upgrades:
# Safety net для remote upgrades
set system option reboot-on-upgrade-failure 600
# Add system image
add system image https://example.com/vyos.iso
# System автоматически reboot если upgrade failsRoot Partition Auto-Resize
Automatic Root Filesystem Expansion
Автоматическое расширение root partition при загрузке:
Enable Auto-Resize:
# Расширить root filesystem при первой загрузке
set system option root-partition-auto-resize
commit
saveDisable:
delete system option root-partition-auto-resize
commitПрименение в Cloud
Yandex Cloud:
# При увеличении disk size в консоли
set system option root-partition-auto-resize
commit
save
# Reboot для применения
reboot nowVK Cloud:
# После resize instance disk
set system option root-partition-auto-resize
commit
reboot nowПроверка расширения
# Disk space до
df -h /
# После reboot с auto-resize
df -h /
# Filesystem должен использовать весь доступный diskManual Resize (альтернатива)
# Growpart для partition expansion
sudo growpart /dev/vda 1
# Resize filesystem
sudo resize2fs /dev/vda1
# Проверка
df -h /Kernel Options
Disable CPU Mitigations
Отключение CPU mitigations для производительности (Spectre, Meltdown):
Disable Mitigations:
# Отключить CPU vulnerability mitigations
set system option kernel disable-mitigations
commit
save
reboot nowWarning: Отключение mitigations снижает security для повышения performance. Используйте только в trusted environments.
Disable Power Saving
Отключение CPU power saving для максимальной производительности:
Disable Power Saving:
# Максимальная performance без power saving
set system option kernel disable-power-saving
commit
save
reboot nowПрименение:
- High-performance compute workloads
- Низкая latency applications
- Когда power consumption не критична
AMD P-State Driver
Настройка AMD P-State driver mode (для AMD CPUs):
Available Modes:
# Passive mode (default)
set system option kernel amd-pstate-driver passive
# Active mode (более aggressive power management)
set system option kernel amd-pstate-driver active
# Guided mode (balance)
set system option kernel amd-pstate-driver guided
commit
save
reboot nowPassive Mode:
- Default mode
- Legacy frequency scaling
- Better compatibility
Active Mode:
- Hardware-controlled frequency
- Better power efficiency
- Newer AMD CPUs
Guided Mode:
- Hybrid approach
- Balance performance/power
Quiet Boot
Скрыть kernel boot messages:
Enable Quiet Boot:
# Минимальные boot messages
set system option kernel quiet
commit
save
reboot nowDisable (verbose boot):
delete system option kernel quiet
commit
reboot nowПроверка Kernel Options
# Boot parameters
cat /proc/cmdline
# CPU frequency governor
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# CPU mitigations
cat /sys/devices/system/cpu/vulnerabilities/*Примеры конфигураций
Пример 1: Yandex Cloud - Performance Tuning
Scenario: High-throughput compute instance в Yandex Cloud.
configure
# Throughput optimization
set system option performance throughput
# HTTP client для metadata service
set system option http-client source-interface eth0
# Auto-resize для disk expansion
set system option root-partition-auto-resize
# Reboot on panic для availability
set system option reboot-on-panic
# Disable unnecessary beep
set system option startup-beep
# Ignore CTRL-ALT-DELETE
set system option ctrl-alt-delete ignore
# Kernel optimizations
set system option kernel disable-power-saving
commit
save
# Reboot для применения kernel options
reboot nowРезультат:
- Максимальная network throughput
- Автоматический disk resize
- High availability через reboot on panic
- Оптимизированная производительность
Пример 2: VK Cloud - Low Latency VoIP Router
Scenario: VoIP router в VK Cloud требующий минимальных задержек.
configure
# Latency optimization
set system option performance latency
# SSH через management network
set system option ssh-client source-interface eth1
set system option ssh-client source-address 172.16.1.10
# HTTP через management
set system option http-client source-interface eth1
set system option http-client source-address 172.16.1.10
# Reboot on panic
set system option reboot-on-panic
# Ignore CTRL-ALT-DELETE
set system option ctrl-alt-delete ignore
# Disable startup beep
set system option startup-beep
# Kernel options для low latency
set system option kernel disable-power-saving
commit
save
reboot nowРезультат:
- Минимальная network latency для VoIP
- Isolated management traffic
- Consistent performance
Пример 3: Enterprise Datacenter - Security-Focused
Scenario: Enterprise router с focus на security.
configure
# Balanced performance (no specific profile)
# Используем default
# HTTP client control
set system option http-client source-interface eth2
set system option http-client source-address 192.168.100.1
# SSH client control
set system option ssh-client source-interface eth2
set system option ssh-client source-address 192.168.100.1
# Security settings
set system option ctrl-alt-delete ignore
# Reboot on panic disabled для forensics
delete system option reboot-on-panic
# Disable beep
set system option startup-beep
# Keep CPU mitigations enabled (default)
# Не используем disable-mitigations для security
# Quiet boot для cleaner console
set system option kernel quiet
commit
save
reboot nowРезультат:
- Controlled management traffic
- Security mitigations enabled
- Production-ready configuration
Пример 4: Development Lab - Convenience
Scenario: Development/testing environment.
configure
# Throughput для testing
set system option performance throughput
# CTRL-ALT-DELETE reboot для удобства
set system option ctrl-alt-delete reboot
# Reboot on panic
set system option reboot-on-panic
# Verbose boot для debugging
delete system option kernel quiet
# German keyboard для локального console
set system option keyboard-layout de
commit
save
reboot nowРезультат:
- Удобство для developers
- Easy troubleshooting
- Fast recovery
Мониторинг и диагностика
Проверка системных опций
# Все system options
show configuration system option
# Specific option
show configuration system option performance
show configuration system option http-client
show configuration system option ssh-clientPerformance Metrics
Network Throughput:
# Interface statistics
show interfaces ethernet eth0
# Detailed stats
show interfaces ethernet eth0 statistics
# Monitor traffic
monitor interface eth0Latency Testing:
# Ping test
ping 8.8.8.8
# MTR для latency analysis
mtr 8.8.8.8
# Traffic capture
monitor traffic interface eth0HTTP Client Verification
# Test HTTP source
curl -v http://example.com
# Check connection source
tcpdump -i eth1 -n port 80
# Verify routing
show ip routeSSH Client Verification
# SSH с verbose
ssh -v user@remote-host
# Check SSH source
# На remote host:
tail -f /var/log/auth.log
# Должен показать source addressKernel Parameters
# Boot command line
cat /proc/cmdline
# CPU frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# Performance stats
cat /proc/stat
# Memory usage
free -h
# System load
uptimePerformance Testing
Throughput Test:
# iperf3 server на remote
iperf3 -s
# iperf3 client на VyOS
iperf3 -c remote-server -t 60
# Должен показать high throughput с throughput profileLatency Test:
# hping3 для latency
sudo hping3 -1 remote-server --fast
# sockperf для network latency
sockperf ping-pong -i remote-server -p 5001Troubleshooting
Performance Profile не работает
Проблема: Performance profile не улучшает производительность.
Причины:
- System не был rebooted после изменений
- Hardware limitations
- Bottleneck в другом месте (CPU, disk)
Решение:
# Проверить конфигурацию
show configuration system option performance
# Проверить kernel parameters
cat /proc/cmdline | grep performance
# Если нет - reboot required
reboot now
# После reboot verify
cat /proc/sys/net/core/rmem_max
cat /proc/sys/net/core/wmem_maxHTTP Client Source не работает
Проблема: HTTP requests не используют configured source.
Причины:
- Source interface down
- No route через source interface
- Source address не на source interface
Диагностика:
# Check interface status
show interfaces
# Check routing table
show ip route
# Check source address
ip addr show eth1
# Test connectivity
ping -I eth1 8.8.8.8Решение:
# Verify source interface up
show interfaces ethernet eth1
# Verify source address exists
show interfaces ethernet eth1 address
# Fix if needed
set interfaces ethernet eth1 address 10.0.1.1/24
# Verify routing
set protocols static route 0.0.0.0/0 next-hop 10.0.1.254 interface eth1
commitKeyboard Layout не изменился
Проблема: Keyboard layout остался прежним после настройки.
Причины:
- System не был rebooted
- Опция задана неправильно
- Console vs SSH confusion
Решение:
# Verify configuration
show configuration system option keyboard-layout
# Reboot system
reboot now
# After reboot test на console (не SSH)
# SSH использует client keyboard layoutCTRL-ALT-DELETE не игнорируется
Проблема: CTRL-ALT-DELETE вызывает reboot несмотря на ignore.
Причины:
- Configuration не saved
- Systemd не обновлен
- Testing на SSH (не работает, только console)
Решение:
# Set ignore
set system option ctrl-alt-delete ignore
commit
save
# Verify systemd
systemctl status ctrl-alt-del.target
# Test только на physical consoleReboot on Panic не срабатывает
Проблема: System не reboots при kernel panic.
Причины:
- Panic timeout не задан
- Hardware hang
- Panic слишком серьезный для reboot
Решение:
# Enable reboot on panic
set system option reboot-on-panic
commit
# Set panic timeout
set system sysctl parameter kernel.panic value 10
commit
save
# Test trigger panic (ONLY IN TEST ENVIRONMENT)
# echo c > /proc/sysrq-triggerRoot Partition не расширился
Проблема: Root partition не expanded после disk resize.
Причины:
- System не был rebooted
- Partition table не обновлена
- Filesystem уже maximum size
Диагностика:
# Check disk size
lsblk
# Check filesystem size
df -h /
# Check partition table
sudo fdisk -l /dev/vdaРешение:
# Enable auto-resize
set system option root-partition-auto-resize
commit
save
# Reboot
reboot now
# Manual resize если auto-resize failed
sudo growpart /dev/vda 1
sudo resize2fs /dev/vda1
# Verify
df -h /Kernel Options не применились
Проблема: Kernel options (disable-mitigations, disable-power-saving) не active.
Причины:
- System не был rebooted
- Hardware не поддерживает опцию
- Conflicting kernel parameters
Диагностика:
# Check boot parameters
cat /proc/cmdline
# Should see mitigations=off если configured
# Should see processor.max_cstate=0 для disable-power-savingРешение:
# Verify configuration
show configuration system option kernel
# Reboot required для kernel options
reboot now
# After reboot verify
cat /proc/cmdline
# Check CPU governor
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governorБезопасность
Performance vs Security Trade-offs
Disable CPU Mitigations:
# Повышает performance НО снижает security
set system option kernel disable-mitigationsРиски:
- Уязвим к Spectre, Meltdown attacks
- Side-channel vulnerabilities
- Используйте только в trusted networks
Рекомендация:
# Production - keep mitigations enabled (default)
delete system option kernel disable-mitigations
# Trusted lab - можно disable для performance
set system option kernel disable-mitigationsCTRL-ALT-DELETE Security
Production:
# Всегда ignore для предотвращения accidental reboots
set system option ctrl-alt-delete ignorePhysical Security:
- Console access должен быть физически защищен
- Ignore CTRL-ALT-DELETE не заменяет physical security
- Monitor console access
Source Address Security
Whitelisting:
# Control source для HTTP/SSH
set system option http-client source-address 10.0.1.1
set system option ssh-client source-address 10.0.1.1
# Remote firewalls могут whitelist эти IPsAudit:
# Log outgoing connections
set system syslog host 192.168.1.100 facility local0 level info
# Monitor source addresses
tcpdump -i any -n | grep "10.0.1.1"Интеграция с облачными платформами
Yandex Cloud Metadata Service
HTTP Client для Metadata:
# Ensure metadata requests через правильный interface
set system option http-client source-interface eth0
# Metadata service IP: 169.254.169.254
# Должен быть доступен через eth0
commitTesting:
# Test metadata access
curl http://169.254.169.254/latest/meta-data/
# Should return metadataVK Cloud Instance Metadata
Similar Configuration:
# HTTP client через primary interface
set system option http-client source-interface eth0
# VK Cloud metadata service
curl http://169.254.169.254/openstack/latest/meta_data.json
commitCloud Disk Auto-Resize
Yandex Cloud:
# При увеличении disk в консоли
set system option root-partition-auto-resize
commit
save
reboot now
# После reboot filesystem expandedVK Cloud:
# Similar process
set system option root-partition-auto-resize
commit
save
reboot nowЛучшие практики
Performance Tuning:
- Используйте throughput profile для file servers, backup
- Используйте latency profile для VoIP, gaming, real-time apps
- Test before/after для измерения improvement
- Reboot после изменения performance profile
HTTP/SSH Client Source:
- Настройте source для predictable routing
- Whitelist source addresses на remote firewalls
- Document source configurations для troubleshooting
- Test connectivity после изменений
Keyboard Layout:
- Настройте если используете non-US keyboard на console
- Помните: только для console, не SSH
- Reboot required после изменения
Startup Beep:
- Disable в datacenter для noise reduction
- Keep enabled в small deployments для diagnostic
- Personal preference
CTRL-ALT-DELETE:
- Всегда ignore в production
- Physical console security критична
- Document behavior для operations team
Reboot on Panic:
- Enable в production для automatic recovery
- Disable в development для debugging
- Set reasonable panic timeout (10-60 секунд)
- Monitor panic events
Root Auto-Resize:
- Enable для cloud instances с dynamic disks
- Test resize procedure перед production
- Monitor filesystem space после resize
Kernel Options:
- Disable mitigations только в trusted environments
- Disable power-saving для consistent performance
- AMD P-State для новых AMD CPUs
- Always test после kernel changes
Change Management:
- Test system options в lab environment
- Document all changes
- Plan reboot windows
- Backup configuration перед changes
- Verify после reboot
Monitoring:
- Monitor performance metrics после tuning
- Track source address usage
- Log kernel panics
- Alert on unexpected reboots
Заключение
Системные опции VyOS предоставляют гибкие инструменты для настройки поведения системы и оптимизации производительности. Ключевые возможности:
- Performance profiles - throughput и latency optimization для specific workloads
- HTTP/SSH client source - контроль исходящих connections для security и routing
- Keyboard layout - поддержка различных layouts для console access
- System behavior - настройка startup beep, CTRL-ALT-DELETE, reboot on panic
- Kernel options - advanced tuning для performance и power management
- Cloud integration - auto-resize и metadata service support
Правильная конфигурация system options позволяет:
- Оптимизировать performance под specific use cases
- Улучшить security через source address control
- Повысить availability через automatic reboot on panic
- Упростить cloud deployment через auto-resize
Используйте system options для адаптации VyOS под ваши специфические требования:
- High-throughput workloads → throughput profile
- Low-latency applications → latency profile
- Cloud environments → auto-resize и metadata configuration
- Enterprise security → source address control и mitigations enabled
Всегда тестируйте изменения в non-production environment и планируйте reboot windows, так как большинство опций требуют system restart для применения.