192.168.1.1-· | 192.168.0.1-·

linuxѧϰ֮·֮IPַ·ɵ

ʱ䣺2014-07-17 08:34

ipԼ鿴ipϢأ
ʹifconfig
﷨ʽ
ifconfig :κѡʾֻʾӿΪup״̬ĽӿϢ
Ifconfig -a:ʾʾнӿڵĽӿϢܸýӿupdownʾ
 
ʹifconfigipķ֣
һIfconfig interface [ip/netmask] [up|down]
ʾΪýӿip룬رոýӿ
磺ifconfig eth0 192.168.0.120/24  up

ifconfig interface ip-address netmask [up|down]
ʾΪýӿip룬رոýӿ
netmaskΪؼ
磺ifconfig 192.168.0.110 netmask 255.255.255.0 up
ifconfig interface ip-address netmask [up|down]
ʾΪýӿip룬رոýӿ
netmaskΪؼ
磺ifconfig 192.168.0.110 netmask 255.255.255.0 up
 
ʹַipipЧЧҲ˵һͻʧЧ
ķʽRHEL5RHEL6ϲͬ
RHEL5ĻΪ/etc/init.d/network/{start|stop|restart|status}
RHEL6ĻΪ/etc/init.d/network/{start|stop|restart|status}
Щ˼Ϊ
start:
stopֹͣ
restart
status鿴״̬
ļ/etc/sysconfig/network
 
һбʾǷ繦
ڶбʾǷipv6


бʾǰϵͳ
 
ո˵ʹifconfigõipЧҪЧ뽫д뵽ļȥ
ӿڵļΪ:/etc/sysconfig/network-scripts/ifcfg-INTERFACE_NAME
INTERFACE_NAMEΪӿƣÿһӿڶӦһļ
ļҪΪ
DEVICE=#:ĽӿƣINTERFACE_NAMEһ
BOOTPROTO={static|none|dhcp|bootp}:Э飬ʾʹַʽȡip
Static|none:ʹþ̬ʽȡ
DhcpʹdhcpЭȡ
IPADDR=#:IPַ
NETMASK=#:
GATEWAY=#:趨Ĭ
ONBOOT={yes|no}:ʾǷ񼤻
HWADDR=#:趨ӲַҲMACַҪӲеĵַһ£пʡ
USERCTL={yes|no}:Ƿͨûƴ˽ӿ
PEERDNS={yes|no}:ǷBOOTPROTOΪdhcpʱDHCPָDNSַ
 
ҪļЧ

Ҫʹifconfigip鿴ϢġʵifconfigһֱȽϵָォһip-------ip
Ipifconfigrouteָ˹ܸӵǿ
﷨ʽ
ip link:鿴ӿ(ַ)Ϣ߹رӿ
ip  [-s] link show:鿴װеӿϢ
   -s:ʾװõͳݣstatisticsܰͷͳȥİϢ
ip link set INTERFACE_NAME [up|down] :رijӿ
磺ip link set eth0 down
 
ip addr/address :ijӿipɾip
ip addr/address [add|del|flush|show]  [IP-ADDRESS/mask] [dev ӿ] [to PREFIX ]
add:ijӿip
delɾijӿڵĵַ
show鿴ijӿڵipϢ
 
flush:ijӿڵipַ
IP-ADDRESS/mask:ipַ
PREFIX:ƥַǰ׺ַǰ׺
      
ip route趨·
ip route [show|add|del] [ip] [via gateway] [dev ӿ]
showʾ·ɱ
add·
delɾ·
Via һĸسȥ

  • һƪ·Է
  • һƪ·ɱüͬʱʹ
  • - RSSͼ - - - վͼ - Ȩ