Google Code Prettify - 輕量級的語法上色工具

星期四, 10月 03, 2013

CentOS setup static Network

手動
ifconfig eth0 210.244.49.163 netmask 255.255.255.128
route del default
route add default gw 210.244.49.253
echo "nameserver 210.244.49.170" > /etc/resolv.conf

啟動 eth0
ifconfig eth0 up

開機自動
#設定ip及mask
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:15:5D:31:A0:00
TYPE=Ethernet
UUID=6a5c6654-6e7e-4fd0-98aa-d71d28d5ecf1
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=210.244.49.162
'PREFIX=25
NETMASK=255.255.255.128
DEFROUTE=yes

#'IPV4_FAILURE_FATAL=yes
#'IPV6INIT=no
#'NAME=eth0
#'USERCTL=no

#設定Gateway(default route)
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cewb
GATEWAY=210.244.49.253

#設定 DNS ((nameserver )
vi /etc/resolv.conf
search nidify.com
nameserver 210.244.49.170 #第一個 nameserver (primary DNS)
nameserver 8.8.8.8 #第二個 nameserver (secondary DNS)

reboot

http://blog.miniasp.com/post/2012/07/30/CentOS-63-Minimal-Installation-and-Configuration-Notes.aspx
http://xmodulo.com/2013/02/how-to-set-a-default-gateway-on-centos.html