Networking2011/11/09 |
[1] | Set static IP address to the server, DHCP is not recommended if you use as a server. |
[root@dlp ~]#
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
[root@dlp ~]# HWADDR=00:0c:29:78:cc:fd # change BOOTPROTO= none ONBOOT=yes NM_CONTROLLED=yes # add follows # this server's IP address IPADDR=10.0.0.30 # subnet mask NETMASK=255.255.255.0 TYPE=Ethernet # default gateway GATEWAY=10.0.0.1 # DNS server's IP address DNS1=10.0.0.10 IPV6INIT=no USERCTL=no PREFIX=24 systemctl restart network.service [root@dlp ~]# chkconfig network on [root@dlp ~]# eth0 Link encap:Ethernet HWaddr 00:0C:29:78:CC:FD inet addr:10.0.0.30 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe78:ccfd/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:110 errors:0 dropped:0 overruns:0 frame:0 TX packets:91 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11828 (11.5 KiB) TX bytes:9390 (9.1 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:792 (792.0 b) TX bytes:792 (792.0 b) |
Sponsored Link |