<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.asteroidos.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin+Kofler</id>
	<title>AsteroidOS - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.asteroidos.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin+Kofler"/>
	<link rel="alternate" type="text/html" href="https://wiki.asteroidos.org/index.php/Special:Contributions/Kevin_Kofler"/>
	<updated>2026-06-16T18:02:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://wiki.asteroidos.org/index.php?title=IP_Connection&amp;diff=688</id>
		<title>IP Connection</title>
		<link rel="alternate" type="text/html" href="https://wiki.asteroidos.org/index.php?title=IP_Connection&amp;diff=688"/>
		<updated>2025-08-10T18:33:09Z</updated>

		<summary type="html">&lt;p&gt;Kevin Kofler: /* Paranoid Kernels */ Fix a small grammar error / typo I made.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Configuring an IP connection on your watch has to be done manually until a GUI settings option is available. On watches that support WLAN, you can enable Wi-Fi and configure the connection using &amp;lt;code&amp;gt;connmanctl&amp;lt;/code&amp;gt; like described below. Forwarding IP requests to a connected PC via USB is another option, explained in the second paragraph.&lt;br /&gt;
&lt;br /&gt;
By default, there is no &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; password, and no firewall rules. (However, on some watches, the kernel has the &amp;lt;code&amp;gt;CONFIG_ANDROID_PARANOID_NETWORK&amp;lt;/code&amp;gt; kernel option enabled, see below.) A password can be set using the passwd command.&lt;br /&gt;
&lt;br /&gt;
= IP over WLAN (WiFi) =&lt;br /&gt;
Connect to your watch using &amp;lt;code&amp;gt;ssh root@192.168.2.15&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;adb shell&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# connmanctl&lt;br /&gt;
connmanctl&amp;gt; enable wifi&lt;br /&gt;
connmanctl&amp;gt; scan wifi&lt;br /&gt;
connmanctl&amp;gt; services&lt;br /&gt;
connmanctl&amp;gt; agent on&lt;br /&gt;
connmanctl&amp;gt; connect wifi_CODE-FOR-YOUR-SSID&lt;br /&gt;
connmanctl&amp;gt; quit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether an IP address has been assigned to the watch using &amp;lt;code&amp;gt;ip a show dev wlan0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ifconfig wlan0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that activated WLAN consumes additional power. Currently, it is recommended to disable the function after use. &amp;lt;code&amp;gt;connmanctl disable wifi&amp;lt;/code&amp;gt; is used to disable Wi-Fi and power off WLAN temporarily. &amp;lt;code&amp;gt;connmanctl enable wifi&amp;lt;/code&amp;gt; activates WLAN again and connects to the last used Wi-Fi network.&lt;br /&gt;
&lt;br /&gt;
Some more documentation on connman can be found on [https://wiki.archlinux.org/index.php/ConnMan#Connecting_to_a_protected_access_point ArchWiki].&lt;br /&gt;
&lt;br /&gt;
= IP over USB =&lt;br /&gt;
It is possible to allow your watch to be able to use your Linux computer&#039;s internet connection via a USB connection. You will need:&lt;br /&gt;
&lt;br /&gt;
# A Linux computer with RNDIS support loaded and enabled&lt;br /&gt;
# The ability to change network configurations on that computer&lt;br /&gt;
# A network connection&lt;br /&gt;
&lt;br /&gt;
This works by using the RNDIS driver to allow the USB device to appear to be a network interface. RNDIS stands for &amp;quot;Remote Network Driver Interface Specification&amp;quot; and was a proprietary protocol from Microsoft. It is supported in Linux by the &amp;lt;code&amp;gt;rndis_host&amp;lt;/code&amp;gt; driver. This driver may either be compiled into the kernel, or more typically provided as an optional module. If you&#039;re not sure, you can try this &amp;lt;code&amp;gt;lsmod&amp;lt;/code&amp;gt; to see if it&#039;s loaded on your computer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lsmod | grep ndis&lt;br /&gt;
rndis_host             24576  0&lt;br /&gt;
cdc_ether              24576  1 rndis_host&lt;br /&gt;
usbnet                 61440  2 rndis_host,cdc_ether&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it isn&#039;t you might be able to use &amp;lt;code&amp;gt;modprobe rndis_host&amp;lt;/code&amp;gt; (with root privileges) to install the module.&lt;br /&gt;
&lt;br /&gt;
Once the &amp;lt;code&amp;gt;rndis_host&amp;lt;/code&amp;gt; is installed and running, you can enable Network Address Translation (NAT) to allow your Linux computer to share it&#039;s internet IP address with the watch. To configure a NAT &#039;&#039;&#039;on your computer&#039;&#039;&#039; (Note: Replace eth0 with the name of the interface that connects your computer to the Internet) with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here again, you might need root privileges for those commands, depending on how your computer is configured.&lt;br /&gt;
&lt;br /&gt;
Configure a default gateway and DNS &#039;&#039;&#039;on the watch&#039;&#039;&#039; with the following commands ran via [[SSH]] as the root user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;route add default gw 192.168.2.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;nameserver 8.8.8.8&amp;quot; &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this assumes that your computer&#039;s IP address on RNDIS is 192.168.2.1, which is the default, but if you have multiple watches, or have plugged and unplugged the same watch a few times, it might be different. To make sure, on the watch, you can type &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; and it will reply with something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
root            pts/0           00:01   Jun  9 08:06:24  192.168.2.2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this particular case, the address shown is 192.168.2.2, so the first command listed above would be &amp;lt;code&amp;gt;route add default gw 192.168.2.2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Paranoid Kernels =&lt;br /&gt;
On some watch models (e.g., &amp;lt;code&amp;gt;lenok&amp;lt;/code&amp;gt;), the kernel shipped with AsteroidOS is compiled with the Android-specific &amp;lt;code&amp;gt;CONFIG_ANDROID_PARANOID_NETWORK&amp;lt;/code&amp;gt; kernel option enabled. That option enforces non-standard restrictions on networking, based on hardcoded group IDs (GIDs):&lt;br /&gt;
* GID 3003 is the &amp;lt;code&amp;gt;inet&amp;lt;/code&amp;gt; group, allowing to create &amp;lt;code&amp;gt;AF_INET&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AF_INET6&amp;lt;/code&amp;gt; sockets,&lt;br /&gt;
* GID 3004 is the &amp;lt;code&amp;gt;net_raw&amp;lt;/code&amp;gt; group, allowing to create raw INET sockets.&lt;br /&gt;
&lt;br /&gt;
Only &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and members of the groups with those magic GIDs are allowed to perform the described actions. In particular, by default, the &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; user is &#039;&#039;&#039;not&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to be able to access the network as &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; (e.g., for &amp;lt;code&amp;gt;asteroid-weatherfetch&amp;lt;/code&amp;gt; to work), SSH into your watch as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; (or use &amp;lt;code&amp;gt;adb shell&amp;lt;/code&amp;gt;) and run the following 2 commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
groupadd -g 3003 -U root,ceres inet&lt;br /&gt;
groupadd -g 3004 -U root,ceres net_raw&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These create the two magic groups with the same name and GID as on Android and add both &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; to them. Then reboot your watch, because only newly started sessions will pick up the new group memberships.&lt;/div&gt;</summary>
		<author><name>Kevin Kofler</name></author>
	</entry>
	<entry>
		<id>https://wiki.asteroidos.org/index.php?title=IP_Connection&amp;diff=687</id>
		<title>IP Connection</title>
		<link rel="alternate" type="text/html" href="https://wiki.asteroidos.org/index.php?title=IP_Connection&amp;diff=687"/>
		<updated>2025-08-10T00:53:23Z</updated>

		<summary type="html">&lt;p&gt;Kevin Kofler: Document CONFIG_ANDROID_PARANOID_NETWORK restrictions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Configuring an IP connection on your watch has to be done manually until a GUI settings option is available. On watches that support WLAN, you can enable Wi-Fi and configure the connection using &amp;lt;code&amp;gt;connmanctl&amp;lt;/code&amp;gt; like described below. Forwarding IP requests to a connected PC via USB is another option, explained in the second paragraph.&lt;br /&gt;
&lt;br /&gt;
By default, there is no &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; password, and no firewall rules. (However, on some watches, the kernel has the &amp;lt;code&amp;gt;CONFIG_ANDROID_PARANOID_NETWORK&amp;lt;/code&amp;gt; kernel option enabled, see below.) A password can be set using the passwd command.&lt;br /&gt;
&lt;br /&gt;
= IP over WLAN (WiFi) =&lt;br /&gt;
Connect to your watch using &amp;lt;code&amp;gt;ssh root@192.168.2.15&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;adb shell&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# connmanctl&lt;br /&gt;
connmanctl&amp;gt; enable wifi&lt;br /&gt;
connmanctl&amp;gt; scan wifi&lt;br /&gt;
connmanctl&amp;gt; services&lt;br /&gt;
connmanctl&amp;gt; agent on&lt;br /&gt;
connmanctl&amp;gt; connect wifi_CODE-FOR-YOUR-SSID&lt;br /&gt;
connmanctl&amp;gt; quit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check whether an IP address has been assigned to the watch using &amp;lt;code&amp;gt;ip a show dev wlan0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ifconfig wlan0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that activated WLAN consumes additional power. Currently, it is recommended to disable the function after use. &amp;lt;code&amp;gt;connmanctl disable wifi&amp;lt;/code&amp;gt; is used to disable Wi-Fi and power off WLAN temporarily. &amp;lt;code&amp;gt;connmanctl enable wifi&amp;lt;/code&amp;gt; activates WLAN again and connects to the last used Wi-Fi network.&lt;br /&gt;
&lt;br /&gt;
Some more documentation on connman can be found on [https://wiki.archlinux.org/index.php/ConnMan#Connecting_to_a_protected_access_point ArchWiki].&lt;br /&gt;
&lt;br /&gt;
= IP over USB =&lt;br /&gt;
It is possible to allow your watch to be able to use your Linux computer&#039;s internet connection via a USB connection. You will need:&lt;br /&gt;
&lt;br /&gt;
# A Linux computer with RNDIS support loaded and enabled&lt;br /&gt;
# The ability to change network configurations on that computer&lt;br /&gt;
# A network connection&lt;br /&gt;
&lt;br /&gt;
This works by using the RNDIS driver to allow the USB device to appear to be a network interface. RNDIS stands for &amp;quot;Remote Network Driver Interface Specification&amp;quot; and was a proprietary protocol from Microsoft. It is supported in Linux by the &amp;lt;code&amp;gt;rndis_host&amp;lt;/code&amp;gt; driver. This driver may either be compiled into the kernel, or more typically provided as an optional module. If you&#039;re not sure, you can try this &amp;lt;code&amp;gt;lsmod&amp;lt;/code&amp;gt; to see if it&#039;s loaded on your computer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lsmod | grep ndis&lt;br /&gt;
rndis_host             24576  0&lt;br /&gt;
cdc_ether              24576  1 rndis_host&lt;br /&gt;
usbnet                 61440  2 rndis_host,cdc_ether&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it isn&#039;t you might be able to use &amp;lt;code&amp;gt;modprobe rndis_host&amp;lt;/code&amp;gt; (with root privileges) to install the module.&lt;br /&gt;
&lt;br /&gt;
Once the &amp;lt;code&amp;gt;rndis_host&amp;lt;/code&amp;gt; is installed and running, you can enable Network Address Translation (NAT) to allow your Linux computer to share it&#039;s internet IP address with the watch. To configure a NAT &#039;&#039;&#039;on your computer&#039;&#039;&#039; (Note: Replace eth0 with the name of the interface that connects your computer to the Internet) with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here again, you might need root privileges for those commands, depending on how your computer is configured.&lt;br /&gt;
&lt;br /&gt;
Configure a default gateway and DNS &#039;&#039;&#039;on the watch&#039;&#039;&#039; with the following commands ran via [[SSH]] as the root user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;route add default gw 192.168.2.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;nameserver 8.8.8.8&amp;quot; &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this assumes that your computer&#039;s IP address on RNDIS is 192.168.2.1, which is the default, but if you have multiple watches, or have plugged and unplugged the same watch a few times, it might be different. To make sure, on the watch, you can type &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; and it will reply with something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
root            pts/0           00:01   Jun  9 08:06:24  192.168.2.2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this particular case, the address shown is 192.168.2.2, so the first command listed above would be &amp;lt;code&amp;gt;route add default gw 192.168.2.2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Paranoid Kernels =&lt;br /&gt;
On some watch models (e.g., &amp;lt;code&amp;gt;lenok&amp;lt;/code&amp;gt;), the kernel shipped with AsteroidOS is compiled with the Android-specific &amp;lt;code&amp;gt;CONFIG_ANDROID_PARANOID_NETWORK&amp;lt;/code&amp;gt; kernel option enabled. That option enforces non-standard restrictions on networking, based on hardcoded group IDs (GIDs):&lt;br /&gt;
* GID 3003 is the &amp;lt;code&amp;gt;inet&amp;lt;/code&amp;gt; group, allowing to create &amp;lt;code&amp;gt;AF_INET&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AF_INET6&amp;lt;/code&amp;gt; sockets,&lt;br /&gt;
* GID 3004 is the &amp;lt;code&amp;gt;net_raw&amp;lt;/code&amp;gt; group, allowing to create raw INET sockets.&lt;br /&gt;
&lt;br /&gt;
Only &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and members of the groups with those magic GIDs are allowed to perform the described actions. In particular, by default, the &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; user is &#039;&#039;&#039;not&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Therefore, in order to be able to access the network as &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; (e.g., for &amp;lt;code&amp;gt;asteroid-weatherfetch&amp;lt;/code&amp;gt; to work), SSH into your watch as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; (or use &amp;lt;code&amp;gt;adb shell&amp;lt;/code&amp;gt;) and run the following 2 commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
groupadd -g 3003 -U root,ceres inet&lt;br /&gt;
groupadd -g 3004 -U root,ceres net_raw&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These create the two magic groups with the same name and GID as on Android and adds both &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ceres&amp;lt;/code&amp;gt; to them. Then reboot your watch, because only newly started sessions will pick up the new group memberships.&lt;/div&gt;</summary>
		<author><name>Kevin Kofler</name></author>
	</entry>
</feed>