临时设置ip地址(重启开发板失效)
ifconfig eth0 192.168.0.100 netmask 255.255.255.0
route add default gw 192.168.0.1
永久设置ip地址
vi /etc/profile,然后把前面临时配置ip地址的两行命令写到里面。
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
if [ "$PS1" ]; then
if [ "`id -u`" -eq 0 ]; then
export PS1='[\u@\h:\w]# '
else
export PS1='[\u@\h:\w]$ '
fi
fi
export PAGER='/bin/more '
export EDITOR='/bin/vi'
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
unset i
done
ifconfig eth0 192.168.0.100 netmask 255.255.255.0
route add default gw 192.168.0.1
如果重启不生效,发现修改的东西没了需要检查输入的对不对