V
V
Vladimir Singhtlov2018-11-11 22:24:27
Docker
Vladimir Singhtlov, 2018-11-11 22:24:27

How to access the Internet from a docker macvlan container?

There is a computer with 2 network interfaces
eth0 internet pppoe
eth1 local network, the cable goes to the router, which distributes wifi, dhcp itself distributes from the interface.
eth0 works outside only nginx
eth1 created by macvlan, there is access to containers between containers and inside the network,
but there is no access from the container, if you attach the default bridge, the container will be available outside, I don’t need it, these are internal services.
transmission:
container_name: transmission
build: ./config/transmission
restart: always
volumes:
- /data/downloads:/downloads
- /data/torrents:/watch
- /data/transmission:/config
ports:
- "9091:9091"
- "51413:51413"
- "51413:51413/udp"
environment:
- PGID=1001
- PUID=1001
- TZ=Europe/Moscow
networks:
homenet:
ipv4_address: 192.168.0.5
networks:
n1:
driver: macvlan
driver_opts:
parent: eth1
macvlan_mode: bridge
ipam:
config:
- subnet: 192.168.0.0/24

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Singhtlov, 2018-11-13
@singhtless

ports were simply thrown out on all interfaces of the main host
ports:
- "9091"
- "51413"
- "51413/udp"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question