Thursday, October 22, 2015

How to start network linux automatically



Step 1: Check your network

[root@PTUDServer3 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 74:46:A0:98:D0:BE 
          inet addr:192.168.2.133  Bcast:10.61.118.255  Mask:255.255.255.0
          inet6 addr: fe80::7646:a0ff:fe98:d0be/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7002 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1357 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:592469 (578.5 KiB)  TX bytes:118837 (116.0 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:2456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2456 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:278546 (272.0 KiB)  TX bytes:278546 (272.0 KiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:D9:D3:A7 
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:D9:D3:A7 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Step 2: Set ONBOOT=yes

[root@PTUDServer3 ~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=c47a963d-3fb0-44f5-b3c7-4ff8d619a043
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.2.133
PREFIX=24
GATEWAY=192.168.1.1
DNS1=10.79.255.10
HWADDR=74:46:A0:98:D0:BE
DOMAIN=10.79.255.12
LAST_CONNECT=1443171251

Step 3: Start network with OS.

[root@PTUDServer3 ~]# chkconfig network on

Step 4: Test Network

[root@PTUDServer3 ~]# service network restart
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
                                                           [  OK  ]
[root@PTUDServer3 ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=65.6 ms


Share this

0 Comment to "How to start network linux automatically"

Post a Comment