Configure Networking2009/06/10 |
[1] | The settings of networking is DHCP by default. Change it to static one if you use the computer as a network server. |
[root@dlp ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 # change # name DEVICE=eth0 HWADDR=00:0C:29:88:5C:40
ONBOOT=yes # IP address for eth0 IPADDR=192.168.0.20 BOOTPROTO=static # subnet mask NETMASK=255.255.255.0 TYPE=Ethernet # IP address of default gateway GATEWAY=192.168.0.1 # IP address of DNS DNS1=192.168.0.10 IPV6INIT=no USERCTL=no PREFIX=24 NAME="System eth0" [root@dlp ~]# /etc/rc.d/init.d/NetworkManager stop Stopping NetworkManager daemon: [ OK ] [root@dlp ~]# /etc/rc.d/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] [root@dlp ~]# chkconfig NetworkManager off [root@dlp ~]# chkconfig network on [root@dlp ~]# eth0 Link encap:Ethernet HWaddr 00:0C:29:88:5C:40 inet addr:192.168.0.20 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe88:5c40/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1534 errors:0 dropped:0 overruns:0 frame:0 TX packets:1469 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:132650 (129.5 KiB) TX bytes:184685 (180.3 KiB) Interrupt:17 Base address:0x1080 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:30 errors:0 dropped:0 overruns:0 frame:0 TX packets:30 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3087 (3.0 KiB) TX bytes:3087 (3.0 KiB) |
Sponsored Link |