ARM Linux系统修改动态IP为静态IP地址

# Wired or wireless interfaces                                                  
auto eth0                                                                       
#iface eth0 inet dhcp                                                           
#        pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cm
                                                                          
iface eth0 inet static                                                    
        address 10.40.49.53                                               
        netmask 255.255.255.0                                                   
        network 10.40.49.1                                                      
        gateway 10.40.49.254
<span style="font-family:Microsoft YaHei;"><strong>》<a target=_blank href="http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece763104687270e54f734628081412c88d25f93130a1c187bbbe066785713d4b17a600aad4d5cfdf74271200454b48cc8ff109be4cc3c6ad567627f4fc61e05d269b8bb4432b627875b99b868ecad873884d8d6c4ae5544cb23120af7e7fb5a1765bb78836526e2d6c20a&p=8c77890485cc43dd08e29f754b50&newp=8b2a9710c59714fb0fbd9b75064792695d0fc20e3fd4d2406c80c61cc4&user=baidu&fm=sc&query=arm%B0%E5%C9%E8%D6%C3%BE%B2%CC%ACIP&qid=b0c5c3ef00015298&p1=8">参考</a>《</strong></span>

不少人都不知道在ARM Linux系统下如何修改动态IP为静态IP地址,其实只要两个步骤就能够搞定。html

首先,使用vi打开 /etc/network/interfaces 目录,命令以下:
  1. vi /etc/network/interfaces

其次,将 “# Wired or wireless interfaces”这一行下的网络这是进行修改

(1)将 “红框1” 这一行注释掉,修改后为:
  1. #iface eth0 inet dhcp
(2)添加 静态IP 配置,内容以下。

  1.          iface eth0 inet static
  2.          address 192.168.1.100
  3.          netmask 255.255.255.0
  4.          network 192.168.1.0
  5.          gateway 192.168.1.1
注意,其中auto eth0这一行保留,不能删除。

(3)保存interfaces文件,重启网络或开发系统就OK了
  1. /etc/init.d/networking restart