Activating an additional USB Wifi Adapter - android-things

I'm trying to add a wifi hotspot/access point to my raspberry pi running Android Things OS. I figured I would do this by adding an additional USB Wifi Adapter (Edimax EW-7811Un) and bridge it with the pi's internal wifi adapter.
Unfortunately, I am not linux savvy and am used to plug and play with windows and osx and not having to tweak any configurations manually!
After googling and running the various commands, I can see the adapter has been found.
Searching though dmesg, I can see the device...
[ 4.131380] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 4.232604] usb 1-1.4: New USB device found, idVendor=7392, idProduct=7811
[ 4.232616] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.232624] usb 1-1.4: Product: 802.11n WLAN Adapter
[ 4.232630] usb 1-1.4: Manufacturer: Realtek
[ 4.232637] usb 1-1.4: SerialNumber: 00e04c000001
Running lusb shows the device (004)...
rpi3:/ # lsusb
Bus 001 Device 002: ID 0424:9514
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 0424:ec00
Bus 001 Device 004: ID 7392:7811
But running ifconfig /a only shows the default hardware...
wlan0 Link encap:Ethernet HWaddr b8:27:eb:87:50:67 Driver brcmfmac_sdio
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2a00:23c4:7400:5c00:d848:e0c3:e997:182/64 Scope: Global
inet6 addr: fdaa:bbcc:ddee:0:d848:e0c3:e997:182/64 Scope: Global
inet6 addr: fdaa:bbcc:ddee:0:691d:ecb5:3fd2:94e0/64 Scope: Global
inet6 addr: 2a00:23c4:7400:5c00:7b46:c90f:599a:4551/64 Scope: Global
inet6 addr: fe80::29c9:aa36:a6bb:ddc5/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2121 errors:0 dropped:42 overruns:0 frame:0
TX packets:1775 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:474636 TX bytes:889088
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 TX bytes:0
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:33 errors:0 dropped:0 overruns:0 frame:0
TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:4154 TX bytes:4154
eth0 Link encap:Ethernet HWaddr b8:27:eb:d2:05:32 Driver smsc95xx
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0
Can anyone advise whether Android Things OS can support an additional USB Wifi Adapter and if so, what I need to do to make the device active?

Related

Connect to docker using IP instead of localhost

I'm running a docker container (running a cloudera image in which I can't modify the networks settings) in my windows 10 pc and I want to connect to it from my browser using the assigned IP (i.e. 172.17.0.2) instead of localhost.
Is there a way to do it? How?
(I've found this post and I've tried to use the --net=host option but the docker0 IP assigned is still 172.17.0.1.)
Below the "ifconfig" output:
[root#quickstart /]# ifconfig
cni0 Link encap:Ethernet HWaddr 6A:6A:D3:6A:CB:82
inet addr:10.1.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::686a:d3ff:fe6a:cb82/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12920 errors:0 dropped:0 overruns:0 frame:0
TX packets:13154 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:884288 (863.5 KiB) TX bytes:3946860 (3.7 MiB)
docker0 Link encap:Ethernet HWaddr 02:42:65:2D:65:6C
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
inet6 addr: fe80::42:65ff:fe2d:656c/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:154 errors:0 dropped:0 overruns:0 frame:0
TX packets:215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10104 (9.8 KiB) TX bytes:185370 (181.0 KiB)
docker_gwbridge Link encap:Ethernet HWaddr 02:42:FF:2D:D6:CD
inet addr:172.18.0.1 Bcast:172.18.255.255 Mask:255.255.0.0
inet6 addr: fe80::42:ffff:fe2d:d6cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:339368 errors:0 dropped:0 overruns:0 frame:0
TX packets:339368 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:63421670 (60.4 MiB) TX bytes:63421670 (60.4 MiB)
eth0 Link encap:Ethernet HWaddr 02:50:00:00:00:01
inet addr:192.168.65.3 Bcast:192.168.65.15 Mask:255.255.255.240
inet6 addr: fe80::50:ff:fe00:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:131024 errors:0 dropped:0 overruns:0 frame:0
TX packets:76313 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:157839066 (150.5 MiB) TX bytes:8175888 (7.7 MiB)
hvint0 Link encap:Ethernet HWaddr 00:15:5D:CD:11:09
inet addr:10.0.75.2 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::215:5dff:fecd:1109/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:257 errors:0 dropped:53 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21003 (20.5 KiB) TX bytes:1358 (1.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:339368 errors:0 dropped:0 overruns:0 frame:0
TX packets:339368 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:63421670 (60.4 MiB) TX bytes:63421670 (60.4 MiB)
veth535bb6e Link encap:Ethernet HWaddr 16:E5:EC:F3:76:BC
inet6 addr: fe80::14e5:ecff:fef3:76bc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:2318 (2.2 KiB)
vethc291b186 Link encap:Ethernet HWaddr 72:3A:FE:9F:40:7A
inet6 addr: fe80::703a:feff:fe9f:407a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6296 errors:0 dropped:0 overruns:0 frame:0
TX packets:6441 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:518245 (506.0 KiB) TX bytes:1959228 (1.8 MiB)
vethc0969f7 Link encap:Ethernet HWaddr F2:9E:81:04:9B:69
inet6 addr: fe80::f09e:81ff:fe04:9b69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74394 errors:0 dropped:0 overruns:0 frame:0
TX packets:129442 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8037110 (7.6 MiB) TX bytes:157544590 (150.2 MiB)
vethdba5d116 Link encap:Ethernet HWaddr 26:D1:6D:9B:28:8E
inet6 addr: fe80::24d1:6dff:fe9b:288e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6262 errors:0 dropped:0 overruns:0 frame:0
TX packets:6457 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:516002 (503.9 KiB) TX bytes:1960294 (1.8 MiB)
vethf1ece51f Link encap:Ethernet HWaddr 72:A3:6A:C9:70:37
inet6 addr: fe80::70a3:6aff:fec9:7037/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:362 errors:0 dropped:0 overruns:0 frame:0
TX packets:351 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:30921 (30.1 KiB) TX bytes:34060 (33.2 KiB)
I guess you have some misunderstanding for docker network.
Docker use veth pair as the default bridge technology to communicate between host & container, see next diagram:
So, 172.17.0.1 is just a bridge between your host's network card & containers' network card, you couldn't use it direclty. Meanwhile, you should not use container's ip from your host's browser to visit it as it's in a private network which setup by docker, what you could do is use -p to publish your internal network service to external.
And, when you visit localhost, it in fact just visit host's network, and docker use iptables to pass your network traffic to container's port through docker0 bridge. So, for your case, if you do not want to use localhost, then you could use host's ip instead, that is 192.168.65.3 in your case.

Accessing docker container app running on guest KVM from Ubuntu host

My setup is:
Ubuntu server 16.04 running on headless appliance (host)
Windows server 2016 KVM (guest) running on top of the host.
Network type between host and guest is NAT. The whole thing is behind corp. proxy.
The host is getting static IP from the corp gateway.
On the KVM I'm running docker container app that is listening on port 15417 from inside and outside (docker ps: 0.0.0.0:15417 -> 15417/tcp)
The container IP address is 192.168.122.35, while the KVM IP address from NAT is: 192.168.122.82
The app running on the docker container is exposing an API that should be accessed from the linux host on kvm_ip:15417/api
The facts:
Port 15417 is opened on the windows FW for inbound TCP connection.
There is a working ping from the host to kvm IP (192.168.122.82)
The app api can be accessed on 192.168.122.35:15417/api
docker logs, displays logs so the app is up and running.
The problems:
The API cannot be accessed from the KVM on localhost:15417/api or 127.0.0.1:15417/api, the response I get for curl localhost:15417/api is:
Destination host unreachable
The API cannot be accessed from 192.168.122.82:15417/api (KVM_IP) on host, same response on curl 192.168.122.82:15417/api as on the kvm powershell.
No telnet to 192.168.122.82 15417 from host or telnet 127.0.0.1 15417 from guest, while telnet to other ports like RDP (3389) or vnc (5900) is working fine, meaning the ports are all open.
Here's my host 'ifconfig':
br0 Link encap:Ethernet HWaddr 00:90:0b:67:e3:4c
inet addr:172.28.69.86 Bcast:172.28.69.87 Mask:255.255.255.248
inet6 addr: fe80::290:bff:fe67:e34c/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:597 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:89816 (89.8 KB) TX bytes:648 (648.0 B)
br-ef89294aca4b Link encap:Ethernet HWaddr 02:42:3d:dc:07:b1
inet addr:172.20.0.1 Bcast:172.20.255.255 Mask:255.255.0.0
inet6 addr: fe80::42:3dff:fedc:7b1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:80271 errors:0 dropped:0 overruns:0 frame:0
TX packets:51030 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:98712118 (98.7 MB) TX bytes:4318906 (4.3 MB)
docker0 Link encap:Ethernet HWaddr 02:42:ea:f9:4a:a6
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
enp2s0 Link encap:Ethernet HWaddr 00:90:0b:67:e3:4b
inet addr:172.28.69.84 Bcast:172.28.69.255
Mask:255.255.255.248
inet6 addr: fe80::290:bff:fe67:e34b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43437560 errors:0 dropped:0 overruns:0 frame:0
TX packets:28285024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:50031414909 (50.0 GB) TX bytes:5610346118 (5.6 GB)
Memory:df800000-df8fffff
enp3s0 Link encap:Ethernet HWaddr 00:90:0b:67:e3:4c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:dfe00000-dfe7ffff
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2528921 errors:0 dropped:0 overruns:0 frame:0
TX packets:2528921 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:3180228446 (3.1 GB) TX bytes:3180228446 (3.1 GB)
veth38444b2 Link encap:Ethernet HWaddr b2:43:0f:a2:0e:34
inet6 addr: fe80::b043:fff:fea2:e34/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 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:1728 (1.7 KB) TX bytes:816 (816.0 B)
veth55c3534 Link encap:Ethernet HWaddr 52:e3:a5:c0:54:84
inet6 addr: fe80::50e3:a5ff:fec0:5484/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4329603 errors:0 dropped:0 overruns:0 frame:0
TX packets:4447953 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1018418030 (1.0 GB) TX bytes:1107337021 (1.1 GB)
vetha9c713b Link encap:Ethernet HWaddr 02:96:67:47:1c:72
inet6 addr: fe80::96:67ff:fe47:1c72/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:175785 errors:0 dropped:0 overruns:0 frame:0
TX packets:124544 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:45484242 (45.4 MB) TX bytes:22613601 (22.6 MB)
vethcfde2a8 Link encap:Ethernet HWaddr ca:ab:04:da:b6:98
inet6 addr: fe80::c8ab:4ff:feda:b698/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:990878 errors:0 dropped:0 overruns:0 frame:0
TX packets:1367424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:212266708 (212.2 MB) TX bytes:287696403 (287.6 MB)
vethd045150 Link encap:Ethernet HWaddr 42:b0:0f:df:b3:ec
inet6 addr: fe80::40b0:fff:fedf:b3ec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:431061 errors:0 dropped:0 overruns:0 frame:0
TX packets:423829 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:102897883 (102.8 MB) TX bytes:91172674 (91.1 MB)
vethe3e3d6f Link encap:Ethernet HWaddr 76:21:a7:44:81:7d
inet6 addr: fe80::7421:a7ff:fe44:817d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1598 errors:0 dropped:0 overruns:0 frame:0
TX packets:1924 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:597484 (597.4 KB) TX bytes:350579 (350.5 KB)
vethf34ccaa Link encap:Ethernet HWaddr 76:a9:29:e3:b5:2c
inet6 addr: fe80::74a9:29ff:fee3:b52c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2674 errors:0 dropped:0 overruns:0 frame:0
TX packets:3783 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4805257 (4.8 MB) TX bytes:689076 (689.0 KB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:17:94:ca
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23845306 errors:0 dropped:0 overruns:0 frame:0
TX packets:31454109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1454280991 (1.4 GB) TX bytes:48875445867 (48.8 GB)
vnet0 Link encap:Ethernet HWaddr fe:54:00:fc:b7:f1
inet6 addr: fe80::fc54:ff:fefc:b7f1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4512098 errors:0 dropped:0 overruns:0 frame:0
TX packets:4084521 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:580069804 (580.0 MB) TX bytes:2979706156 (2.9 GB)
And my KVM (guest) networking default config:
<network>
<name>default</name>
<uuid>9f80b5ad-b4fa-4c7e-a559-d27c23328347</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:17:94:ca'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>
And finally the KVM network interface configuration is:
<interface type='network'>
<mac address='52:54:00:fc:b7:f1'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
I struggling while trying to find out what is interrupting ,me from accessing the app on KVM from the host.

How to make sure the docker container has desired network interfaces

When I run ifconfig command on host machine(ubuntu) I see following interfaces
docker0 Link encap:Ethernet HWaddr 02:42:af:2d:7b:4e
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:afff:fe2d:7b4e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17372371 errors:0 dropped:0 overruns:0 frame:0
TX packets:18910860 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3877362521 (3.8 GB) TX bytes:5648219155 (5.6 GB)
eth0 Link encap:Ethernet HWaddr 00:50:56:bd:6d:6c
inet addr:9.113.140.176 Bcast:9.113.140.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:febd:6d6c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22690545 errors:0 dropped:10 overruns:0 frame:0
TX packets:4168167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5364157575 (5.3 GB) TX bytes:398826434 (398.8 MB)
eth1 Link encap:Ethernet HWaddr 00:50:56:a3:7f:17
inet addr:9.113.140.166 Bcast:9.113.140.255 Mask:255.255.255.0
inet6 addr: fe80::11ff:7a9c:83ed:f11f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16962121 errors:0 dropped:10 overruns:0 frame:0
TX packets:2690 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1214246465 (1.2 GB) TX bytes:515223 (515.2 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:605048269 errors:0 dropped:0 overruns:0 frame:0
TX packets:605048269 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:137424265344 (137.4 GB) TX bytes:137424265344 (137.4 GB)
Where as when I check inside the container I find this
[AppConnect-Container#772840b42460 /]: ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:05
inet addr:172.17.0.5 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16966 errors:0 dropped:0 overruns:0 frame:0
TX packets:12819 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14565227 (14.5 MB) TX bytes:10658766 (10.6 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:984571 errors:0 dropped:0 overruns:0 frame:0
TX packets:984571 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:187746811 (187.7 MB) TX bytes:187746811 (187.7 MB)
I want even the eth1 network interface to be available inside the container. Please let me know how to achieve this
Launch the container with --net=host option, and you'll have your host interfaces in the container.

How to prevent binding to docker0 bridge in overlay mode

I'm trying to use docker with weave, and I'd like to keep interfaces in container clean. That is: I want the only attached interfaces to be weave's and localhost. Currently docker also binds its bridge.
Is it possible to attach only to overlay network in Docker?
$ docker run -ti --net none busybox ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
but
eth1 Link encap:Ethernet HWaddr 02:42:AC:12:00:02
inet addr:172.18.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe12:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:90 (90.0 B) TX bytes:270 (270.0 B)
ethwe0 Link encap:Ethernet HWaddr 52:E6:28:21:75:9A
inet addr:10.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::50e6:28ff:fe21:759a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1410 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:508 (508.0 B) TX bytes:258 (258.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
The network needs to be created with -internal flag, see:
https://github.com/docker/docker/issues/18854

MirageOS and Xen - Virtual interface unable to acquire IP address

I've compiled and built a MirageOS unikernel for XEN following this guide https://github.com/mirage/mirage-www/blob/master/tmpl/wiki/hello-world.md (mostly last part, Step 4, stackv4) but after I launch it I'm not able to pass the DHCP discovery phase, as shown in the following log:
Parsing config from stackv4.xl
Xen Minimal OS!
Initialising console ... done.
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(PATH) -> null
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(TMPDIR) -> null
getenv(TEMP) -> null
Netif: add resume hook
Netif.connect 0
Netfront.create: id=0 domid=0
sg:true gso_tcpv4:true rx_copy:true rx_flip:false smart_poll:false
MAC: 00:16:3e:7e:c0:0d
Attempt to open(/dev/urandom)!
Unsupported function getpid called in Mini-OS kernel
Unsupported function getppid called in Mini-OS kernel
Manager: connect
Manager: configuring
DHCP: start discovery
Sending DHCP broadcast (length 552)
DHCP: start discovery
Sending DHCP broadcast (length 552)
DHCP: start discovery
Sending DHCP broadcast (length 552)
DHCP: start discovery
....
My MirageOS unikernel configuration:
name = 'stackv4'
kernel = '/home/mirage/mirage-skeleton/stackv4/mir-stackv4.xen'
builder = 'linux'
memory = 256
on_crash = 'preserve'
disk = [ ]
# if your system uses openvswitch then either edit /etc/xen/xl.conf and set
# vif.default.script="vif-openvswitch"
# or add "script=vif-openvswitch," before the "bridge=" below:
vif = [ 'bridge=xenbr0' ]
My network configuration:
eth0 Link encap:Ethernet HWaddr 02:01:06:02:83:c0
inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:110876 errors:0 dropped:0 overruns:0 frame:0
TX packets:14602 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9736700 (9.7 MB) TX bytes:1999992 (1.9 MB)
Interrupt:117
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:384394 errors:0 dropped:0 overruns:0 frame:0
TX packets:384394 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26761500 (26.7 MB) TX bytes:26761500 (26.7 MB)
vif16.0 Link encap:Ethernet HWaddr fe:ff:ff:ff:ff:ff
inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58 errors:0 dropped:0 overruns:0 frame:0
TX packets:11289 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:33640 (33.6 KB) TX bytes:778590 (778.5 KB)
xenbr0 Link encap:Ethernet HWaddr 02:01:06:02:83:c0
inet addr:131.159.24.167 Bcast:131.159.25.255 Mask:255.255.254.0
inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:110689 errors:0 dropped:0 overruns:0 frame:0
TX packets:11987 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8328727 (8.3 MB) TX bytes:1703101 (1.7 MB)
My bridge configuration:
bridge name bridge id STP enabled interfaces
xenbr0 8000.0201060283c0 no eth0
vif16.0
My /etc/network/interface:
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
# up ip link set eth0 up
iface eth0 inet manual
auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
I'm trying to understand what is the problem but everything appears to be correct (according to this other guide http://wiki.xen.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)#Example_Debian-style_bridge_configuration_.28e.g._Debian.2C_Ubuntu.29).
Some suggestions:
Check you're actually running a DHCP server.
Run tcpdump or wireshark on the bridge machine (probably dom0) and see what traffic there is. Do you see the DHCP request?
Try configuring a static IP address and see if that works.
Try running a Linux guest and see if DHCP works there (and compare packet captures for that).

Resources