Network interface disabled by default in CentOS 7

After a fresh installation of CentOS 7, your main network interface may be disabled. Its name may be enp0s3.

Check its status with :

nmcli dev status

To enable it permanently, look at its configuration file at /etc/sysconfig/network-scripts/ifcfg-enp0s3 and make the change from :

ONBOOT=no
to
ONBOOT=yes

Restart the network service :

systemctl restart NetworkManager

The network interface status should now be as connected :

nmcli dev status

Advertisements

Disabling IPv6 in Network Manager on Debian Wheezy

If you think that getting an dynamic IP from your ISP box is taking too much time, have a look at how Network Manager is working on your system. Maybe, it is trying to fetch an IP address within a IPv6 subnet that does not exist.

To disable this function, please proceed as follows :

– Right-click on the network status icon
– Click on “Edit Connections”
– Go to the “Wireless” tab
– Select the name of the wireless network
– Click on “Edit”
– Go to the “IPv6 Settings” tab
– In the “Method” dropdown, choose “Ignore”
– Click on “Save”

This trick works on Debian Wheezy. Trick found here

 

RHEL 6 : Network configuration

Network configuration under RHEL 6 has slightly changed. No configuration found if you perform an minimum installation.Networking is managed with NetworkManager by default. On a server, using GUI tools is best to avoid when possible.

To make your networking work out of the box, some changes are needed in a few files.
To make the network interface to configure available with the right information, add any changes in /etc/sysconfig/networking-scripts/ifcfg-eth0. This file should contain at least the following lines :

DEVICE=eth0
HWADDR=MAC_ADDRESS
IPADDR=IP address server
NETMASK= its netmask
BROADCAST= its broadcast
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no

NM_CONTROLLED set to no just tells the system not to use NetworkManager as default networking management tool.

Next step, add the following information in /etc/sysconfig/network :

NETWORKING=yes
GATEWAY= default gateway for the server
HOSTNAME=FQDN of the server

Do not forget to populate /etc/hosts file with localhost, your server’s IP address, its FQDN and aliases

Add the IP addresses of your DNS servers in /etc/resolv.conf :

cat /etc/resolv.conf

search your_domain
nameserver DNS_server1_IP_Address
nameserver DNS_server2_IP_Address

After any changes on the networking configuration, restart the related service :

root@localhost:~#service restart network

To check that the requested network interfaces are up and well configured, check their status :

root@localhost: ~#service status network

If you need to add more parameters to the configuration files above, have a look at this document available on your server :

cat /usr/share/doc/initscripts-9.03.31/sysconfig.txt

How to find the fastest Debian mirror for you?

Netselect-apt is very helpful to find which Debian mirror is the fastest one to download the latest packages or to install ones very quickly. To install it :

root@localhost:~# apt-get install netselect-apt

This package needs netselect to work successfully. neselect-apt will download the list of Debian mirrors and will ping them in a special manner thanks to the netselect command.

Here is the kind of answer you can see after running netselect-apt :

netselect: 6 (6 active) nameserver request(s)…
Duplicate address 150.65.7.130 (ftp://ftp.jaist.ac.jp/pub/Linux/Debian/, ftp://ftp.jp.debian.org/debian/); keeping only under first name.
netselect: 4 (4 active) nameserver request(s)…
Duplicate address 140.110.123.9 (ftp://ftp.twaren.net/debian/, ftp://ftp.ncnu.edu.tw/debian/); keeping only under first name.
Running netselect to choose 1 out of 319 addresses.
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………
The fastest server seems to be:
ftp://ftp.de.debian.org/debian/

Some useful options can be used :

-f : replace HTTP mirrors by FTP mirrors.

-n : will add non-free section to the fastest mirror found

a source.list file is generated in your home directory. If you want to use it instead of the current one :

root@localhost:~# mv  /etc/apt/sources.list /etc/apt/sources.list.save

root@localhost~#cp  $HOME/sources.list /etc/apt/

root@localhost:~# apt-get update

$HOME : it stands for your own home directory where the sources.list file has been generated by netselect-apt.

More information :

Debian package description for netselect-apt

Official website for the netselect program

Caching DNS lookups with Firefox/Iceweasel

At the moment, I am running the Debian current stable version of Iceweasel (3..0.6).
Sometimes, you can experience some delay in displaying web pages because DNS lookups take too long. There are several solutions to this problem.
With my current version of Iceweasel, I advise you to install the following addon : DNS Prefetch.
To install it,  just follow this link : DNS Prefetch
Once installed, restart your browser and pay attention to the speed of webpages loading.
Enjoy !

Further informations :

https://developer.mozilla.org/En/Controlling_DNS_prefetching

Checking your Ethernet adapter

To know whether your Ethernet adapter is on or off :

root@localhost:~# mii-tool

mii-tool belongs to the net-tools Debian package. Make sure it is installed on your system.

Here are some examples of use of mii-tool command :

root@localhost:~# mii-tool

eth0: negotiated 100baseTx-FD flow-control, link ok

More details about your connection :

root@localhost:~# mii-tool -v

eth0: negotiated 100baseTx-FD flow-control, link ok
  product info: vendor 00:07:32, model 17 rev 2
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control