我的地盘我做主! 博客:http://tester2test.cnblogs.com/   msn:win_soft@163.com

Redhat中通过命令工具和配置文件设置TCP/IP参数的方法

上一篇 / 下一篇  2007-12-13 10:45:08 / 个人分类:其他

①ifconfig命令
,x N R4EVG mQ;}(e0用ifconfig命令修改后重起服务配置不保存
qC!Qs TC&~ x,`0给Eth0接口设置IP地址和子网掩码广播地址并激活:ifconfig eth0 192.168.1.155 netmask 255.255.255.0 broadcast 192.168.1.255 UP51Testing软件测试网!Z9@.`E%p#?|
更改Eth0口的MAC地址:ifconfig eth0 hw ehter 00:40:64:c8:03:0451Testing软件测试网@S0v8z9U0h
一个网卡添加多个IP:ifoconfig eht0:1 192.168.1.156 ifconfig eth1:192.168.157
,uD } f-o)`M^0添加网关:route add default gw 192.168.1.1
8d*m m*q1D2gP0动态获取IP:ifconfig eth0 -dynamic
{ Fr2f8J j0②netconfig工具
w?,[;e4~e'R0netconfig命令后 可以选择静态还是动态获取IP,选择静态后
2z'ni+H3Mx.H0IP address:IP地址51Testing软件测试网jV_2?Y[#xJ+]|
netmask:子网掩码
k8U0Pt X0default gateway (IP):网关51Testing软件测试网H,E |mi0yh
Primary nameserver: DNS地址
;U&T'R)Wbg0如果只想配置某一项51Testing软件测试网2q1S t tr
修改IP是动态还是动态获取netconfig --bootproto=dhcp|bootp51Testing软件测试网Q-Gs u'cj4Us
设置子网掩码netconfig --netmask=255.255.255.0
z fz_q0设置IP地址netconfig --ip=192.168.1.12451Testing软件测试网3}&M9UDT9r4T3O
设置DNS地址netconfig --nameserver=218.30.19.4051Testing软件测试网[eS-Lo` ^O:k
netconfig默认是设置Eth0网卡的如果想设置其他网卡在device=这打网卡名称51Testing软件测试网8n Rvy0h
netconfig -d --device=eht1
g$_/c*NLI9`;A2F&Z0修改完毕后需要重起服务.不重其服务不生效 51Testing软件测试网8QED:Q"j|;B:u ^6W
③/etc/sysconfig/network-scripts/ifcfg-eth0
fz6S.rX8L0dev=eth0 网卡的物理名称
Sv9} ?F%x0ONBOOT=yes 启动系统时是否启动
n E(?y&w&pR0BOOTPROTO=static|dynamic 静态还是动态获取IP
-AwbP$|#Vj7cnD0K0ipadd=192.168.1.123 IP地址
y!|Xx6s)ms#|:?u@0netmask=255.255.255.0 子网掩码
*WTSovXy0network=192.168.1.0   网络地址51Testing软件测试网9ATA Y"RT*Z
boradcast=192.168.1.255 广播地址
:pXc:@6c:b0gateway=192.168.1.1 网关
w dU1e|S }x0#GATEWAYDEV=eth0 与次网关通讯所使用的网卡物理名称51Testing软件测试网 tRF%R }gy K
修改完毕后需要重起服务.不重其服务不生效 51Testing软件测试网@6HP.rp#Hq.Tn

R%h#V)P K3X,E0
测试者家园 2007-08-03 10:52 发表评论
51Testing软件测试网$_Pe){,~/V/c d
51Testing软件测试网rmY)A+y J+~6H-haI
Link URL: http://www.cnblogs.com/tester2test/archive/2007/08/03/841225.html

TAG:

 

评分:0

我来说两句

Open Toolbar