配置Tizen OS的静态IP地址

时间:2014-02-24 05:28:19

标签: tizen static-ip-address systemd

对于Tizen OS来说,我们已经安装了Tizen的Build机器,我需要配置静态IP地址。我的机器上没有安装ConnMan Tools。我在每个只用ConnMan工具提到的博客上都浏览了很多博客。有没有办法用命令行配置IP地址,就像我们在Fedora或Solaris中通过更新networking-scripts文件夹下的脚本文件一样。

1 个答案:

答案 0 :(得分:0)

试试这个(记得设置正确的IP和MAC):

1)创建文件'/etc/init.d/eth0'并为其设置执行权限(555很好):

#!/bin/sh

HWADDR='fe:fe:fe:fe:xx:xx'
IP='10.10.xx.xxx'
NETMASK='255.255.255.0'

ifconfig eth0 hw ether $HWADDR
ifconfig eth0 $IP netmask $NETMASK up

2)创建文件'/usr/lib/systemd/system/eth0-setup.service':

[Unit]
Description=Configure MAC on eth0 interface
DefaultDependencies=no
Before=net-config.service

[Service]
Type=simple
ExecStart=/etc/init.d/eth0

[Install]
WantedBy=network.target

3)验证:运行第一个脚本并查看eth0是否已启动并根据需要运行。重新启动并查看它是否在引导时配置。