Network settings in RHEL7

Here are some useful notes about network settings in RHEL7.

  • Set hostname
# hostnamectl set-hostname server001
  • Display network devices
# nmcli d
  • Set ipv4 address
# nmcli c modify eth0 ipv4.addresses 192.168.0.30/24
  • Set default gateway
# nmcli c modify eth0 ipv4.gateway 192.168.0.1
  • Set dns
# nmcli c modify eth0 ipv4.dns 8.8.8.8
  • Set manual for static setting ‘(use auto for dhcp)’
# nmcli c modify eth0 ipv4.method manual
  • Restart the network interface ‘(down and up)’
# nmcli c down eth0 && nmcli c up eth0
  • Show settings of a network interface
# nmcli d show eth0
  • Show network interface status
# ip addr show
  • Disable ipv6
# vi /etc/default/grub
# line 6: add
GRUB_CMDLINE_LINUX="ipv6.disable=1 rd.lvm.lv=fedora-server/root.....
  • Apply changing
# grub2-mkconfig -o /boot/grub2/grub.cfg
# systemctl reboot
  • Use network interfaces name like ethX
# vi /etc/default/grub
# line 6: add
GRUB_CMDLINE_LINUX="net.ifnames=0 rd.lvm.lv=fedora/swap rd.md=0.....
  • Apply changing
# grub2-mkconfig -o /boot/grub2/grub.cfg
# systemctl reboot
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s