简体   繁体   English

如何在Raspberry Pi 3上运行的Android Things中设置静态IP

[英]How to set a static IP in Android Things running on Raspberry Pi 3

I wish to change the Ethernet IP Address of the Raspberry Pi3 board that is running Android Things OS. 我希望更改运行Android Things OS的Raspberry Pi3板的以太网IP地址。 Currently it automatically fetches an IP Address available in the connected network. 当前,它会自动获取所连接网络中可用的IP地址。 But I wish to assign a fixed/static IP to the device. 但是我希望为设备分配一个固定/静态IP。 Is it possible to set a static IP using ADB? 是否可以使用ADB设置静态IP?

I don't know the solution based on Android-things. 我不知道基于Android的解决方案。

But I usually try to prevent the use of fixed IP (unless the device runs forever) set in the device itself. 但是我通常会尝试阻止使用设备本身设置的固定IP(除非设备永远运行)。

I prefer to use the DHCP of the modem to set the IP based on the MAC adress. 我更喜欢使用调制解调器的DHCP来基于MAC地址设置IP。 This prevent some conflict. 这样可以避免一些冲突。

You can see more information on this post 您可以在此帖子上看到更多信息

You can set a static IP usually through your router settings. 您通常可以通过路由器设置来设置静态IP。 Try accessing your router settings usually through the web browser at: 尝试通常通过以下Web浏览器访问路由器设置:

http://192.168.0.1/ http://192.168.0.1/

Assuming you have never accessed this the username is usually admin , and the password is password . 假设您从未访问过该用户名,通常是admin ,密码是password You can check the router name online to find the default username and password. 您可以在线检查路由器名称,以找到默认的用户名和密码。

Navigate the menus to find a page which shows you he connected devices. 浏览菜单以找到一个页面,向您显示他已连接的设备。 See pic for an example. 参见图片示例。

图片。

Every routers interface is different. 每个路由器的接口都不相同。

If you have a setting that says DHCP see if you can change it to a reserved IP so that the IP address assigned doesn't change. 如果您有一个说DHCP的设置,请查看是否可以将其更改为保留IP,以使分配的IP地址不变。

Remember different routers have different interfaces so you must do some searching about yours to find the setting. 请记住,不同的路由器具有不同的接口,因此您必须对自己的路由器进行一些搜索才能找到设置。

You can do this from any computer connected to your internet, doesn't have to be on the raspberry to make the changes. 您可以从连接到互联网的任何计算机上执行此操作,而不必在树莓派上进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM