Networking Task: VLAN Setup and Docker Networks¶
Goal¶
Isolate container networks or set up virtual LANs for system-level separation.
VLAN on host (example with nmcli
)¶
nmcli con add type vlan con-name vlan10 dev eth0 id 10 ip4 192.168.10.1/24
nmcli con up vlan10
Docker Custom Bridge¶
docker network create --driver bridge --subnet 192.168.100.0/24 custom-net
Assign Static IP in Compose¶
networks:
internalservices:
ipam:
config:
- subnet: 192.168.100.0/24
services:
app:
networks:
internalservices:
ipv4_address: 192.168.100.10
Tools¶
nmcli
,docker network ls
, Docker Compose