Nothing new here, just stuff I can refer to later when I forget. I’ve usually worked with Debian but am not working with CentOS for a change so some things are new to me.
- If you install CentOS in a machine with less than 1024 MB RAM you don’t get the graphical installation option. So best to install with 1024 MB RAM and then downgrade RAM if you want to. I have a CentOS VM with less than 512 MB RAM. I don’t necessarily need a graphical installation but I prefer it as it’s friendly. I get to choose the hostname for instance, select the packages I want to install, and so on. Without a graphical install you are given a minimal install only with no options to choose.
- Set the hostname in
- Network interfaces are managed by NetworkManager, which is useful if you have a GUI or like to use the
nmclicommand. I prefer old fashioned
ifconfigso I manage my network devices via
NM_CONTROLLED=noin this file to tell NetworkManager not to bother with this interface.
ONBOOT=yesto up this interface on boot up.
GATEWAY=p.q.r.sto set the IPv4 address, netmask, and gateway. Use
BOOTPROTO=dhcpif you’d prefer DHCP instead.
IPV6_AUTOCONF=nois supposed to turn off IPv6 for that interface but it doesn’t seem to. A better way to turn off IPv6 (and/ or control its parameters) is via
- For more options this link from Oracle is a useful reference, as is the initscripts-ipv6 homepage.
- To disable IPv6 on an interface the following
net.ipv6.conf.eth0.disable_ipv6 = 1. Add entries like these to
- The following
sysctlsetting tells the OS to act as a router (i.e. forward packets):
net.ipv4.ip_forward = 1
/etc/resolv.confto specify name servers, domain suffix (via the
domainkeyword), and list of search suffixes (via the
searchkeyword with a space separated list of domains). Domain suffix is the domain name to be added to hosts without a domain name. Search suffixes are additional domain names that can be added to hosts when searching. Use only one of these. If both are specified the last one wins.
- Its best to put the Intranet DNS servers first in
/etc/resolv.conffollowed by Internet DNS servers. In my setup the Intranet servers don’t have access to the Internet and so any Internet name queries to them timeout. When this happens the DNS resolver will automatically try the next server in the list … up to when it reaches the Internet servers and get an answer. To speed the process up use
option timeout:1to set a timeout of 1 second. In contrast if I put the Internet servers first the don’t timeout – they try to resolve the non-existent domain and reply that it does not exist – so the Intranet servers aren’t queried.
CentOS – initial configuration notes by rakhesh is licensed under a Creative Commons Attribution 4.0 International License.