No Network Connectivity


#1

I have installed the anbox snap on Ubuntu 17.10 and it launches and i can install apps via ADB and it seems to work pretty well with the exception of network connectivity. I have this same issue on 3 different 17.10 machines. I have tried recreating the bridge both manually and with the script from the repo. I just can’t get any traffic into or out of the anbox application. Does anyone have any ideas or better yet know the solution?


#2

I’m having this same problem.


#3

Same here. If i try to open an URL i get a “Name not Resolved”. If i try to connect to an IP (HTTP-Server on Host or Web-Interface of my Route) i get “Address unreachable”.

Below is my configuration. swjpilot, webmagnets: Maybe you can check if it’s similar to yours.

Host:

christian@christian-Latitude-E6220:~$ anbox system-info
version: 3
snap-revision: 65
os:
  name: Ubuntu
  version: 17.10 (Artful Aardvark)
  snap-based: true
kernel:
  version: Linux version 4.13.0-16-generic (buildd@lcy01-02) (gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu2)) #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017
  binder: true
  ashmem: true


christian@christian-Latitude-E6220:~$ ps u -C anbox
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      1737  0.1  0.1 569984 11576 ?        Ssl  08:46   0:01 /snap/anbox/65/usr/bin/anbox container-manager --data-path=/var/snap/anbox/commo
christi+  5171  1.5  2.9 2336640 238864 ?      Sl   08:50   0:05 /snap/anbox/65/usr/bin/anbox session-manager
root      5186  0.0  0.1 576284  8092 ?        Ss   08:50   0:00 [lxc monitor] /var/snap/anbox/common/containers default

christian@christian-Latitude-E6220:~$ route
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
default         fritz.box       0.0.0.0         UG    600    0        0 wlp2s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp2s0
192.168.178.0   0.0.0.0         255.255.255.0   U     600    0        0 wlp2s0
192.168.250.0   0.0.0.0         255.255.255.0   U     0      0        0 anbox0

christian@christian-Latitude-E6220:~$ ifconfig -a
anbox0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.250.1  netmask 255.255.255.0  broadcast 0.0.0.0
    inet6 fe80::b87f:4ff:fee7:7e0b  prefixlen 64  scopeid 0x20<link>
    ether fe:e3:45:7f:75:ac  txqueuelen 1000  (Ethernet)
    RX packets 15  bytes 992 (992.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 261  bytes 27548 (27.5 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Lokale Schleife)
    RX packets 300  bytes 22785 (22.7 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 300  bytes 22785 (22.7 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth0VFGFB: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet6 fe80::fce3:45ff:fe7f:75ac  prefixlen 64  scopeid 0x20<link>
    ether fe:e3:45:7f:75:ac  txqueuelen 1000  (Ethernet)
    RX packets 12  bytes 936 (936.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 221  bytes 23950 (23.9 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.178.21  netmask 255.255.255.0  broadcast 192.168.178.255
    inet6 fe80::a639:292:7b27:21fa  prefixlen 64  scopeid 0x20<link>
    inet6 2001:16b8:28be:9800:58aa:6b8f:9e3:ee49  prefixlen 64  scopeid 0x0<global>
    inet6 2001:16b8:28be:9800:49df:7b75:2ee8:29d2  prefixlen 64  scopeid 0x0<global>
    ether c0:18:85:48:96:7c  txqueuelen 1000  (Ethernet)
    RX packets 754  bytes 462557 (462.5 KB)
    RX errors 0  dropped 0  overruns 0  frame 360
    TX packets 1002  bytes 147762 (147.7 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    device interrupt 17  


christian@christian-Latitude-E6220:~$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain /* managed by anbox-bridge */
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain /* managed by anbox-bridge */
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps /* managed by anbox-bridge */
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps /* managed by anbox-bridge */

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             /* managed by anbox-bridge */
ACCEPT     all  --  anywhere             anywhere             /* managed by anbox-bridge */

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination       

christian@christian-Latitude-E6220:~$ bridge link
7: veth0VFGFB state UP @(null): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master anbox0 state forwarding priority 32 cost 2

Anbox (adb shell):

x86_64:/ $ su
x86_64:/ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.250.0   *               255.255.255.0   U     0      0        0 eth0

x86_64:/ # ifconfig -a
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:4 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:248 TX bytes:248 

eth0      Link encap:Ethernet  HWaddr 52:1a:88:bc:b3:28
          inet addr:192.168.250.2  Bcast:192.168.250.255  Mask:255.255.255.0 
          inet6 addr: fe80::501a:88ff:febc:b328/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:230 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:25684 TX bytes:1006 


127|x86_64:/ # ping 192.168.250.1
connect: Network is unreachable
x86_64:/ # ping 192.168.178.21
connect: Network is unreachable
2|x86_64:/ # arping 192.168.250.1
WARNING: using default broadcast address.
ARPING 192.168.250.1 from 192.168.250.2 eth0
Unicast reply from 192.168.250.1 [FE:E3:45:7F:75:AC]  0.542ms
Unicast reply from 192.168.250.1 [FE:E3:45:7F:75:AC]  0.607ms
Unicast reply from 192.168.250.1 [FE:E3:45:7F:75:AC]  0.623ms
Unicast reply from 192.168.250.1 [FE:E3:45:7F:75:AC]  0.600ms
Unicast reply from 192.168.250.1 [FE:E3:45:7F:75:AC]  0.606ms
^CSent 5 probes (1 broadcast(s))
Received 5 response(s)
x86_64:/ # arping 192.168.178.21                                                                                                                
WARNING: using default broadcast address.
ARPING 192.168.178.21 from 192.168.250.2 eth0
Unicast reply from 192.168.178.21 [FE:E3:45:7F:75:AC]  0.527ms
Unicast reply from 192.168.178.21 [FE:E3:45:7F:75:AC]  0.604ms
Unicast reply from 192.168.178.21 [FE:E3:45:7F:75:AC]  0.605ms
Unicast reply from 192.168.178.21 [FE:E3:45:7F:75:AC]  0.597ms
Unicast reply from 192.168.178.21 [FE:E3:45:7F:75:AC]  0.606ms
^CSent 5 probes (1 broadcast(s))
Received 5 response(s)

I tried to add a default gateway:

2|x86_64:/ # ip route add default via 192.168.250.1
x86_64:/ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.250.1   0.0.0.0         UG    0      0        0 eth0
192.168.250.0   *               255.255.255.0   U     0      0        0 eth0

But it didn’t change a thing. Any ideas?


#4

I found this in the log:

11-20 09:09:12.238   117   182 D EthernetNetworkFactory: starting ipProvisioningThread(eth0): mNetworkInfo=[type: Ethernet[], state: UNKNOWN/IDLE, reason: (unspecified), extra: 7e:f4:5f:5e:ae:7c, failover: false, available: true, roaming: false, metered: false]
11-20 09:09:12.238   117   182 I EthernetNetworkFactory: Applying static IPv4 configuration to eth0: IP address 192.168.250.2/24 Gateway 192.168.250.1  DNS servers: [ 8.8.8.8 ] Domains 
11-20 09:09:12.238    38   100 D PermissionCache: checking android.permission.CAPTURE_AUDIO_HOTWORD for uid=1000 => granted (116 us)
11-20 09:09:12.239   117   117 W SoundTriggerHelper: listModules status=0, # of modules=0
11-20 09:09:12.239   117   117 D ContextHubSystemService: onBootPhase: PHASE_SYSTEM_SERVICES_READY
11-20 09:09:12.240    47    81 D CommandListener: Setting iface cfg
11-20 09:09:12.242    47    81 D CommandListener: Trying to bring up eth0
11-20 09:09:12.246   117   182 D ConnectivityService: registerNetworkAgent NetworkAgentInfo{ ni{[type: Ethernet[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: 7e:f4:5f:5e:ae:7c, failover: false, available: true, roaming: false, metered: false]}  network{100}  nethandle{429513165534}  lp{{InterfaceName: eth0 LinkAddresses: [192.168.250.2/24,]  Routes: [192.168.250.0/24 -> 0.0.0.0 eth0,0.0.0.0/0 -> 192.168.250.1 eth0,] DnsAddresses: [8.8.8.8,] Domains: null MTU: 0}}  nc{[ Transports: ETHERNET Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN LinkUpBandwidth>=100000Kbps LinkDnBandwidth>=100000Kbps]}  Score{30}  everValidated{false}  lastValidated{false}  created{false} lingering{false} explicitlySelected{false} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} }
11-20 09:09:12.246   117   166 D ConnectivityService: NetworkAgentInfo [Ethernet () - 100] EVENT_NETWORK_INFO_CHANGED, going from null to CONNECTED
11-20 09:09:12.246   117   182 D EthernetNetworkFactory: exiting ipProvisioningThread(eth0): mNetworkInfo=[type: Ethernet[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: 7e:f4:5f:5e:ae:7c, failover: false, available: true, roaming: false, metered: false]
11-20 09:09:12.269   117   166 D ConnectivityService: Adding iface eth0 to network 100



11-20 09:09:12.269   117   166 D ConnectivityService: Adding iface eth0 to network 100
11-20 09:09:12.269    47    81 E Netd    : netlink response contains error (Invalid argument)
11-20 09:09:12.269    47    81 E Netd    : failed to add interface eth0 to netId 100
11-20 09:09:12.270   117   166 E ConnectivityService: Exception adding interface: java.lang.IllegalStateException: command '11 network interface add 100 eth0' failed with '400 11 addInterfaceToNetwork() failed (Invalid argument)'
11-20 09:09:12.270    47    81 E Netd    : interface eth0 not assigned to any netId
11-20 09:09:12.271   117   166 E ConnectivityService: Exception in addRoute for non-gateway: java.lang.IllegalStateException: command '12 network route add 100 eth0 192.168.250.0/24' failed with '400 12 addRoute() failed (No such device)'
11-20 09:09:12.271    47    81 E Netd    : interface eth0 not assigned to any netId
11-20 09:09:12.271   117   140 W KeyguardServiceDelegate: onScreenTurningOn(): no keyguard service!
11-20 09:09:12.271   117   166 E ConnectivityService: Exception in addRoute for gateway: java.lang.IllegalStateException: command '13 network route add 100 eth0 0.0.0.0/0 192.168.250.1' failed with '400 13 addRoute() failed (No such device)'

11-20 09:09:12.277   117   166 D ConnectivityService: Switching to new default network: NetworkAgentInfo{ ni{[type: Ethernet[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: 7e:f4:5f:5e:ae:7c, failover: false, available: true, roaming: false, metered: false]}  network{100}  nethandle{429513165534}  lp{{InterfaceName: eth0 LinkAddresses: [192.168.250.2/24,]  Routes: [192.168.250.0/24 -> 0.0.0.0 eth0,0.0.0.0/0 -> 192.168.250.1 eth0,] DnsAddresses: [8.8.8.8,] Domains: null MTU: 0}}  nc{[ Transports: ETHERNET Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&FOREGROUND LinkUpBandwidth>=100000Kbps LinkDnBandwidth>=100000Kbps]}  Score{30}  everValidated{false}  lastValidated{false}  created{true} lingering{false} explicitlySelected{false} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} }
11-20 09:09:12.278   117   166 D ConnectivityService: Invalid tcpBufferSizes string: null, using defaults
11-20 09:09:12.278   117   166 E ConnectivityService: Can't set TCP buffer sizes:java.io.FileNotFoundException: /sys/kernel/ipv4/tcp_rmem_min (No such file or directory)

1-20 09:09:12.294   117   166 D ConnectivityService: NetworkAgentInfo [Ethernet () - 100] validation failed
11-20 09:09:12.312   117   132 D         : HostConnection::get() New Host Connection established 0x7febeb52d9c0, tid 132

I don’t know what the netid is, but from this point on, something seems to go wrong:

11-20 09:09:12.269   117   166 D ConnectivityService: Adding iface eth0 to network 100
11-20 09:09:12.269    47    81 E Netd    : netlink response contains error (Invalid argument)
11-20 09:09:12.269    47    81 E Netd    : failed to add interface eth0 to netId 100
11-20 09:09:12.270   117   166 E ConnectivityService: Exception adding interface: java.lang.IllegalStateException: command '11 network interface add 100 eth0' failed with '400 11 addInterfaceToNetwork() failed (Invalid argument)'
11-20 09:09:12.270    47    81 E Netd    : interface eth0 not assigned to any netId
11-20 09:09:12.271   117   166 E ConnectivityService: Exception in addRoute for non-gateway: java.lang.IllegalStateException: command '12 network route add 100 eth0 192.168.250.0/24' failed with '400 12 addRoute() failed (No such device)'
11-20 09:09:12.271    47    81 E Netd    : interface eth0 not assigned to any netId

#5

I tried anbox on Ubuntu 17.04. It works great. Just install it and everthing work out of the box. As you can see here Canonical make some changes to the network configuration in 17.10.


#6

I found a workaround on github:
[https://github.com/anbox/anbox/issues/443#issuecomment-345449671]

Network connectivity work after entering this commands:

adb shell
su
ip route add default dev eth0 via 192.168.250.1
ip rule add pref 32766 table main
ip rule add pref 32767 table local