I have 2 IPs on my server. The main one and an additional one.
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
inet 111.222.204.107/22 brd 213.171.207.255 scope global enp7s0
valid_lft forever preferred_lft forever
inet 111.222.205.143/22 brd 213.171.207.255 scope global secondary enp7s0:0
valid_lft forever preferred_lft forever
inet6 fe80::2e4d:54ff:fe43:92df/64 scope link
valid_lft forever preferred_lft forever
(ive changed the first two parts of the IP for security)
Currently, docker is using the main IP (111.222.204.107 / enp7s0) but I would like it to use the secondary one (111.222.205.143/enp7s0:0).
How best to achieve this. Changing it 'globally' for docker would be great but if I could create docker network and specify the IP for this that would be fine. A third least good option would be to set the IP in docker-compose but would rather do it globaly or for a network.
By 'docker uses' I mean accepts traffic coming from/and sends traffic to the primary IP.
It would be also good to get advice on how to set up IP tables when I do this but I can cross that bridge when I get to it.
I've been struggling with this one for a few days.
0 Answers