Portál AbcLinuxu, 4. prosince 2025 14:36
cat /etc/network/interfaces
#####################################################################
# PHYSICAL INTERFACES
#####################################################################
# WAN
auto enp2s0
iface enp2s0 inet static
address 10.100.2.10/30
gateway 10.100.2.9
dns-nameservers 8.8.8.8 8.8.4.4
#####################################################################
# VLAN INTERFACES
#####################################################################
# vlan100
auto vlan100
iface vlan100 inet static
address 10.10.100.1/24
vlan_raw_device enp3s0
#####################################################################
# BRIDGE INTERFACES
#####################################################################
auto br0
iface br0 inet static
bridge_ports enp3s0
bridge_fd 0
address 10.255.255.1/24
A takto mám dle dokumentace (cat /usr/share/doc/lxc/examples/lxc-vlan.conf) nastavený config LXC kontejneru.
cat config
# Distribution configuration lxc.include = /usr/share/lxc/config/common.conf lxc.arch = linux64 # Container specific configuration lxc.apparmor.profile = generated lxc.apparmor.allow_nesting = 1 lxc.rootfs.path = dir:/var/lib/lxc/proxy.mydomain.cz/rootfs lxc.uts.name = proxy.mydomain.cz # Network configuration lxc.net.0.type = vlan lxc.net.0.vlan.id = 100 lxc.net.0.flags = up lxc.net.0.link = br0 lxc.net.0.hwaddr = 4a:49:43:49:79:bd lxc.net.0.ipv4.address = 10.10.100.15/24Je úplně jedno, jestli lxc.net.0.link = uvedu br0 nebo enp3s0.
lxc.net.0.link = vlan100To vlanid z toho imo muzes s klidem vyhodit. Podotykam, ze tohle samo o osobe ti nezajisti dalsi veci jako je routovani ty vlany, ale rozhodne by sis to mel pingnout. A bridge nanic nepotrebujes, nevim proc to vsichni vsude porad cpou. --- Dete s tim guuglem dopice!
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
#####################################################################
# PHYSICAL INTERFACES
#####################################################################
# WAN
auto enp2s0
iface enp2s0 inet static
address 10.100.2.10/30
gateway 10.100.2.9
dns-nameservers 8.8.8.8 8.8.4.4
dns-search home.local
auto enp2s0
iface enp2s0 inet static
address 10.100.2.222/30
auto enp2s0
iface enp2s0 inet static
address 10.100.3.110/30
auto enp2s0
iface enp2s0 inet static
address 10.100.3.114/30
#####################################################################
# VLAN INTERFACES
#####################################################################
# vlan100
auto vlan100
iface vlan100 inet static
address 10.10.100.1/24
vlan_raw_device enp3s0
# vlan101
auto vlan101
iface vlan101 inet static
address 10.10.101.1/24
vlan_raw_device enp3s0
#####################################################################
# BRIDGE INTERFACES
#####################################################################
auto br0
iface br0 inet static
bridge_ports enp3s0
bridge_fd 0
address 10.255.255.1/24
cat /var/lib/lxc/proxy.home.lan/config # Template used to create this container: /usr/share/lxc/templates/lxc-download # Parameters passed to the template: --no-validate # For additional config options, please look at lxc.container.conf(5) # Uncomment the following line to support nesting containers: lxc.include = /usr/share/lxc/config/nesting.conf # (Be aware this has security implications) # Distribution configuration lxc.include = /usr/share/lxc/config/common.conf lxc.arch = linux64 # Container specific configuration lxc.apparmor.profile = generated lxc.apparmor.allow_nesting = 1 lxc.rootfs.path = dir:/var/lib/lxc/proxy.home.lan/rootfs lxc.uts.name = proxy.home.lan # Network configuration lxc.net.0.type = vlan lxc.net.0.flags = up lxc.net.0.link = vlan100 lxc.net.0.hwaddr = 4a:49:43:49:79:bd lxc.net.0.ipv4.address = 10.10.100.15/24 lxc.net.0.ipv4.gateway = 10.10.100.1...a prostě si 10.10.100.15 nepingnu i kdybych se zbláznil a z kontejneru na 10.10.100.1 taky ne
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.