Tuesday, July 22, 2014

Start network after boot on CentOS

You have two options, use the network-scripts or networkmanager

For myself, I want to use the network scripts. 
chkconfig NetworkManager off
chkconfig network on
Disable the NetworkManager and enable the old network

Then, you need to make sure you are setting up a correct network script at /etc/sysconfig/network-scripts/ifcfg-eth0

make sure ONBOOT=yes

Example of external network interface using DHCP:

$ vim /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
HWADDR=00:26:B9:3E:33:A9
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
DHCP_HOSTNAME=sr2s1
PEERDNS=yes

Example of internal network interface using static IP:

vim /etc/sysconfig/network-scripts/ifcfg-p1p1
DEVICE=p1p1
HWADDR=00:1B:21:44:8D:70
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.0.21
BROADCAST=192.168.0.255
NETMASK=255.255.255.0
NAME=p1p1


update an OpenVZ kernel to the latesr version on CentOS

yum update vzkernel

Update source.list on Ubuntu

http://askubuntu.com/questions/329450/e-some-index-files-failed-to-download-they-have-been-ignored-or-old-ones-used

  • How to solve this trouble in Ubuntu 12.04
Open a terminal (CTRL+ALT+T) and issue the following commands in order.
SOLUTION:
sudo cp /etc/apt/sources.list ~/ 
sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list 
sudo apt-get update
sudo rm /etc/apt/sources.list.d/ubuntu-extras.list
sudo apt-get update
This solution is not general. It is specific to the sources.list file of the Original Poster.
The second command which starts with wget downloads and replaces the sources.list file with a specific for Precise (Ubuntu 12.04) sources.list file. See the file in raw format by visiting this page.
The fourth command removes the ubuntu-extras.list file which had an impact/conflict with another file of the same, so we removed it to avoid the error
W: Duplicate sources.list entry
see comments above.