树莓派添加网卡之后连接时自动设置其Ip
发布日期:2021-06-30 10:11:33 浏览次数:5 分类:技术文章

本文共 1383 字,大约阅读时间需要 4 分钟。

在/etc/dhcpcd.conf中配置:

interface eth1

static ip_address=192.168.4.123/24

完整的一个文件示例:

# A sample configuration for dhcpcd.# See dhcpcd.conf(5) for details.# Allow users of this group to interact with dhcpcd via the control socket.#controlgroup wheel# Inform the DHCP server of our hostname for DDNS.hostname# Use the hardware address of the interface for the Client ID.clientid# or# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.# Some non-RFC compliant DHCP servers do not reply with this set.# In this case, comment out duid and enable clientid above.#duid# Persist interface configuration when dhcpcd exits.persistent# Rapid commit support.# Safe to enable by default because it requires the equivalent option set# on the server to actually work.option rapid_commit# A list of options to request from the DHCP server.option domain_name_servers, domain_name, domain_search, host_nameoption classless_static_routes# Respect the network MTU. This is applied to DHCP routes.option interface_mtu# Most distributions have NTP support.#option ntp_servers# A ServerID is required by RFC2131.require dhcp_server_identifier# Generate SLAAC address using the Hardware Address of the interface#slaac hwaddr# OR generate Stable Private IPv6 Addresses based from the DUIDslaac private# Example static IP configuration:interface eth1static ip_address=192.168.4.123/24

 

转载地址:https://islet.blog.csdn.net/article/details/114373497 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Google最新版无法使用本地文件翻译
下一篇:处理wxPython TreeCtrl刷新节点名称造成的闪烁问题

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月10日 02时50分17秒