arm开发板上电设置静态ip_ARM开发板修改设置静态IP

所用IP是dhcp服务器自动分配的IP地址,每次要使用开发板的IP都很麻烦,更麻烦的是每次还要在代码里改IP。要是有个路由器也好解决,给这个端口固定一个IP地址,而我恰恰是用的交换机还是没办法配置的那种交换机。那就只能通过命令行改IP地址。

一般有两改法:

一、直接配置网口IP地址和掩码

ifconfig eth0 10.150.11.2 netmask 255.254.0.0

在使用命令source命令进行同步,再通过ifconfig查看IP地址,此时地址改成功了。但这种改法也是很麻烦的,每次重启、开机后都得改。

(解释下source:

在linux下man source得到如下解释:

source filename [arguments]

Read  and execute commands from filename in the current shell environment and return the exit status ofthe last command executed from filename.  If filename does not contain a slash, filenames in  PATH  areused  to find the directory containing filename.  The file searched for in PATH need not be executable.

When bash is not in posix mode, the current directory is searched if no file is found in PATH.  If  thesourcepath  option  to the shopt builtin command is turned off, the PATH is

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值