Linux

From Help
Jump to: navigation, search

Return to Main Page

To discover version number

  • SSH or terminal into machine
  • cat /etc/*release

This should work with all Linux versions Return to Top

Find out IP address

  • SSH or terminal into machine
  • at command line:
    • ifconfig

Return to Top

Set/update static IP, netmask, gateway

  • SSH or terminal into machine
  • at command line:
    • nano /etc/sysconfig/network-scripts/ifcfg-eth0
      • this will load up the ifcfg-eth0 configuration file into the Nano text editor.
      • change the eth0 to the correct NIC if you have more than one.
    • update the settings you need to:
    • static IP:
      • DEVICE=eth0
        • depending on which NIC your working with, this might have a different name
      • BOOTPROTO=static
      • BROADCAST=10.0.0.255
        • change this to the broadcast IP for this subnet
      • DHCPCLASS=
        • leave blank for static
      • HWADDR=00:15:5D:00:38:20
        • unless your MAC spoofing, leave this alone
      • IPADDR=10.0.0.4
        • change this to the correct IP you need
      • NETMASK=255.255.255.0
        • change this to the correct netmask you need
      • NETWORK=10.0.0.0
        • this is optional
      • ONBOOT=yes
        • this should always be yes, except for specific circumstances
      • GATEWAY=10.0.0.1
        • change this to your subnet's gateway IP
      • DNS1=10.0.0.59
        • this is optional, and can instead be put in /etc/resolv.conf
      • DNS2=8.8.8.8
        • this is optional, and can instead be put in /etc/resolv.conf
    • hit control X and then y and then ENTER to exit / save
  • restart your Ethernet service:
    • service network restart

Return to Top

Update host, domain name

There are two ways to do this. One is updating two files, the other is a command from the CLI

  • SSH or terminal into machine
  • nano /etc/sysconfig/network
    • update the HOSTNAME= section with the new host name you want
    • update / add NISDOMAIN= and put your domain name in there
    • hit control X and then y to exit / save
  • nano /etc/hosts
    • add in or update the line that has your IP address listed
    • EXAMPLE: 172.16.100.13 servername.yourdomain.com servername
    • change the above IP, FQDN, and friendly name above per your needs
    • hit control X and then y and then ENTER to exit / save

Via the command line:

Return to Top

Reboot or restart

Return to Top