Per me questa è una configurazione molto standard, avevo una macchina Ubuntu che esegue la finestra mobile e ufw come il mio firewall.Il mio firewall sta bloccando le connessioni di rete dal contenitore docker all'esterno
Se il mio firewall è abilitare le istanze della finestra mobile è in grado di connettersi al di fuori
$ docker run -i -t ubuntu /bin/bash
WARNING: Docker detected local DNS server on resolv.conf. Using default external servers: [8.8.8.8 8.8.4.4]
[email protected]:/# apt-get update
Err http://archive.ubuntu.com precise InRelease
0% [Connecting to archive.ubuntu.com]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Ecco il registro ufw che mostra le connessioni bloccate dal contenitore finestra mobile.
$ sudo tail /var/log/ufw.log
Jun 30 15:41:56 localhost kernel: [61609.503199] [UFW BLOCK] IN=testbr0 OUT=eth0 PHYSIN=veth8Rj8Nh MAC=fe:ff:ed:42:b0:01:0a:7c:42:7c:a6:72:08:00 SRC=172.16.42.2 DST=8.8.8.8 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=14886 DF PROTO=UDP SPT=60192 DPT=53 LEN=44
Jun 30 15:42:01 localhost kernel: [61614.500867] [UFW BLOCK] IN=testbr0 OUT=eth0 PHYSIN=veth8Rj8Nh MAC=fe:ff:ed:42:b0:01:0a:7c:42:7c:a6:72:08:00 SRC=172.16.42.2 DST=8.8.4.4 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=16137 DF PROTO=UDP SPT=44812 DPT=53 LEN=44
Jun 30 15:42:06 localhost kernel: [61619.498516] [UFW BLOCK] IN=testbr0 OUT=eth0 PHYSIN=veth8Rj8Nh MAC=fe:ff:ed:42:b0:01:0a:7c:42:7c:a6:72:08:00 SRC=172.16.42.2 DST=8.8.8.8 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=14887 DF PROTO=UDP SPT=60192 DPT=53 LEN=44
Ho provato ad aggiungere una regola utilizzando l'ip.
$ sudo ufw allow in from 172.16.42.2
$ sudo ufw allow out from 172.16.42.2
E nessuna modifica è ancora bloccata.
Come è possibile consentire tutte le connessioni dal contenitore all'esterno con una regola ufw?
Questa soluzione non è più sufficiente per le versioni più recenti della finestra mobile su ufw. – ctbrown