Ubuntu 系统配置IP地址
上一篇 /
下一篇 2009-10-09 11:18:48
/ 个人分类:Linux
l#l'\^f&X6m/n0对于Ubuntu,IP命令行配置如下
W\M\E&q@0:~{zDYh
U+oZ0sudo vi /etc/network/interfaces51Testing软件测试网o2F
T.U z
51Testing软件测试网9DKaG1v9K {q
_2mL`@.~t051Testing软件测试网.iheu-lN}3x_2x1. 动态IP:DHCP51Testing软件测试网
\+y5`9mc)_"t ]o
~0~
rL*ZN7ymI0DHCP配置如下(假设通过eth1上网)
\P_[RFR6p:i|0tm#N!]Y0E0# The primary network interface - use DHCP to find our address51Testing软件测试网.X0h6d{HD(_y
51Testing软件测试网E4U"^+fVON
Hauto eth1
&M&PK4L3oW051Testing软件测试网:^y1aZxviface eth1 inet dhcp //指定为dhcp
,\-M'A#HT9?051Testing软件测试网p0vJ1t
FcDZ然后重启
7W~+om(a.S0o
|051Testing软件测试网p e;ME0@rSsudo /etc/init.d/networking restart51Testing软件测试网Sy&FC(vJ&^Y
51Testing软件测试网TI]9Z;i$Y
J2{ l m1A1w-lc'j051Testing软件测试网"M:|1f'qg5v2. Static IP
+]#~u;zd1eJ}0z051Testing软件测试网+@5w|-h B:\$@静态IP地址配置如下(假设通过eth1上网)
"p)VBX6[$xDLQ051Testing软件测试网f&V
a#Mr*k:Mt# The primary network interface
Td2V$~
CN*^j*V051Testing软件测试网~)R:B k$z*Uauto eth1
D*bfN Y,@*b9MZA N051Testing软件测试网3L*bey+f8t3Z sHiface eth1 inet static //指定为static
CT4O ]X1ix0a!]k^.Udr0address 192.168.3.90 //IP地址51Testing软件测试网tS1Bx7w#xm
51Testing软件测试网2n._0{.Y\#R8f'Qgateway 192.168.3.1 //网关51Testing软件测试网QY(l3o(iq[$jk
51Testing软件测试网P.pB7HC/nnetmask 255.255.255.0 //子网掩码51Testing软件测试网vTK,Qe[}![
-@NbC$Y0同样需要重启
,z/tc0U^`ic,GR%^051Testing软件测试网^:o
JQT7P:xsudo /etc/init.d/networking restart
5pJ.z@:cT$b051Testing软件测试网n.~ WSB/nJp._,hqDNS
9le9lyA3A0`J`V~#X0如果有必要,配置DNS51Testing软件测试网(mn-}~C)O
D-|.U
u)A!q1lD6t$a0sudo gedit /etc/resolv.conf51Testing软件测试网7l)ShdW|Q
51Testing软件测试网!L.u?JY"[:p{Lnameserver 192.168.3.251Testing软件测试网.W5xQ{9V$j|H
相关阅读:
- Ubuntu 8.10下的VNC服务 (Chenny, 2009-4-13)
- Ubuntu 9.04官方正式发布 新增上网本专用版 (51testing, 2009-4-24)
- 用tcl实现ip头部校验和 (shilixiang167, 2009-5-11)
- loadrunner-ip欺骗经验总结 (fairylly, 2009-5-31)
- Build the Android work environment in Ubuntu Linux (yvon_ren, 2009-7-07)
- 虚拟IP(IP spoofer)使用经验、教训 (anhuibing, 2009-7-09)
- Unbutu关于root用户无法使用的方法 (csgood, 2009-7-22)
- Ubuntu配置jdk环境 (csgood, 2009-8-17)
- 如何给Ubuntu装备汉字库 (fishy, 2009-9-17)
- Ubuntu Server 网络配置 (51testing, 2009-9-21)
收藏
举报
TAG:
IP
Ubuntu