Linux - Setting a Static IP (Redhat / CentOS Servers)

1. Configure eth0:

[root@centos63 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="xx:xx:xx:xx:xx:xx"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="xxxxxxxx-05a0-4adf-84fd-850aca6521c7"
IPADDR=192.168.1.54
NETMASK=255.255.255.0

2. Configure Default gateway:

[root@centos63 ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos63.ehowstuff.local
GATEWAY=192.168.1.1

3. Restart Network interface:

[root@centos63 ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]

4. Configure DNS server :

[root@centos63 ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
  • 5 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

Linux - Setting a Static IP (Debian / Ubuntu Servers)

CyberOne Data - Linux Server(Debian / Ubuntu)Setting up a Static IPIntroduction:This howto help's...

How to Mount and Unmount a Partition in Linux

Mounting and Unmounting a Linux PartitionOnce you insert new hard disks into your system, you’ll...

Linux - Setting Virtual (Multiple) IP's (Redhat / CentOS Servers)

Creating Virtual Interface and Assign Multiple IP Addresses Here I have an interface called...

How to change port number on CentOS 7

$sudo vi /etc/ssh/sshd_config *Edit the port number from 22 to 64322 $semanage port -a -t...

CentOS_7 Password Recovery / Single User mode

Password Recovery / Single User Mode (CentOS_7)Steps:1.) Reboot your server2.) When it gets to...

Powered by WHMCompleteSolution