1. 程式人生 > 實用技巧 >Ubuntu修改IP地址

Ubuntu修改IP地址

>>> hot3.png

比如我們用ifconfig 來設定網絡卡eth0的地址
[[email protected] ~]#ifconfig eth0 down
[[email protected] ~]#ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0
[[email protected] ~]#ifconfig eth0 up
[[email protected] ~]#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:03:0D:27:86:41

inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::203:dff:fe27:8641/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:618 errors:0 dropped:0 overruns:0 frame:0
TX packets:676 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:491238 (479.7 KiB) TX bytes:86286 (84.2 KiB)
Interrupt:5 Base address:0x8c00

註解: 上面的例子我們解說一下;
第一行:ifconfig eth0 down 表示如果eth0是啟用的,就把它DOWN掉。此命令等同於 ifdown eth0;
第二行:用ifconfig 來配置 eth0的IP地址、廣播地址和網路掩碼;
第三行:用ifconfig eth0 up 來啟用eth0 ; 此命令等同於 ifup eth0
第四行:用 ifconfig eth0 來檢視 eth0的狀態;

101853_4nX6_592236.png

轉載於:https://my.oschina.net/boonya/blog/525154