My ISP has given me a 10 IP addresses. x.x.x.91-95 and x.x.x.161-165
I want to use 9 of them for my containers.
I have the host eth0 on x.x.x.91
So I did:
docker network create --subnet x.x.x.0/24 --gateway x.x.x.254 mynet
and then
docker run -it --net mynet --ip x.x.x.165 ubuntu /bin/bash
But I can’t connect out. Inside a container:
PING 8.8.8.8 (8.8.8.8): 56 data bytes
3 packets transmitted, 0 packets received, 100% packet loss
# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:5b:cc:d2:a5
inet addr:x.x.x.165 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1296 (1.2 KB) TX bytes:504 (504.0 B)
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 x.x.x.254 0.0.0.0 UG 0 0 0 eth0
x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Any ideas?
Docker version 17.09.0-ce, build afdb6d4