Skip to content

Instantly share code, notes, and snippets.

@mohclips
Created November 14, 2020 20:44
Show Gist options
  • Save mohclips/552f53cd3cc2148c865ed34120984b2b to your computer and use it in GitHub Desktop.
Save mohclips/552f53cd3cc2148c865ed34120984b2b to your computer and use it in GitHub Desktop.
How to define a container on the Local LAN
---
version: "2.4"
services:
test_localnet_ip:
image: alpine:latest
container_name: test_localnet_ip
command: tail -F anything
networks:
HomeLAN:
ipv4_address: 192.168.0.2
networks:
HomeLAN:
driver: macvlan
driver_opts:
# set physical NIC eg. eth0 or physical NIC _and_ VLAN tag here eg. eth0.10
parent: eth0
ipam:
driver: default
config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.254
# our range is .1 to .6
ip_range: 192.168.0.0/29
aux_addresses:
# IPs to ignore in the range above - don't hand these out
my_router: 192.168.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment