Pada waktu kita menginstal Centos 7 minimal instal mungkin kita mengalami tidak adanya IP Address pada Centos 7, terlebih lagi perintah ifconfig juga tidak berjalan. Supaya dapat berjalan ternyata kita harus mengedit configurasi yang sudah ada kemudian menjalankan perintah ‘service network start’ .
Contoh hasil setting dengan editor vi adalah seperti gambar berikut ini:
[root@localhost network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@localhost network-scripts]# ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 62:62:63:61:31:38 brd ff:ff:ff:ff:ff:ff
inet 192.168.21.160/24 brd 192.168.21.255 scope global ens18
valid_lft forever preferred_lft forever
inet6 fe80::6062:63ff:fe61:3138/64 scope link
valid_lft forever preferred_lft forever
[root@localhost network-scripts]# cat ifcfg-ens18
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens18
UUID=08ed4b21-6b56-4e66-8bae-d226817ba68a
DEVICE=ens18
ONBOOT=yes
IPADDR=192.168.21.160
GATEWAY=192.168.21.1
DNS1=192.168.21.1[root@localhost network-scripts]#service network start
Starting network (via systemctl): [ OK ][root@localhost network-scripts]# cat /etc/resolv.conf
nameserver 192.168.21.1
Kemudian command pengganti untuk ifconfig adalah ‘ip addr sh’:
[root@localhost ~]# ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 62:62:63:61:31:38 brd ff:ff:ff:ff:ff:ff
inet 192.168.21.160/24 brd 192.168.21.255 scope global ens18
valid_lft forever preferred_lft forever
inet6 fe80::6062:63ff:fe61:3138/64 scope link
valid_lft forever preferred_lft forever
[root@localhost ~]#
Untuk setting full qualified hostname:
/etc/hostname
/etc/hosts
Atau:
a. Perintahnya: hostnamectl set-hostname hostname
b. Kemudian ipnya disimpan di /etc/hosts silahkan: vi /etc/hosts
Ada kemungkinan firewalld sudah aktif. Sesuai kebutuhan anda kita dapat menonaktifkan
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
Informasi lebih lanjut silahkan mengunjungi
1. Parameter-parameter dalam konfigurasi ifcfg ada di https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s1-networkscripts-interfaces .
2. Setting Static IP pada Centos 7 Minimal installation https://lecturesnippets.com/lesson/setting-a-static-ip-in-a-centos-7-minimal-installation/
3. Instalasi perintah lama ifconfig http://centoshowtos.org/blog/ifconfig-on-centos-7/ .
4. Command systemctl sebagai pengganti command service dan command chkconfig http://www.linuxbrigade.com/centos-7-rhel-7-systemd-commands/ .
5. Editor vi http://www.tutorialspoint.com/unix/unix-vi-editor.htm .
6. Editor nano http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/ .
7. https://docs.iredmail.org/install.iredmail.on.rhel.html
Kunjungi www.proweb.co.id untuk menambah wawasan anda.