If you have any questions or comments, please do not hesitate to submit them in the comment section below. You now know how to configure a static IP address on a Linux distro. Your static IP address has been configured. Restart the networking on your system with: # /etc/init.d/network restart Save the file and then edit /etc/nf like this: # nano /etc/nf You may see a line looking like this: auto eth0Ĭhange it so it looks like this: auto eth0 To setup static IP address in Debian/ Ubuntu, open the following file: # nano /etc/network/interfaces Once you have made your changes restart the networking with: # /etc/init.d/network restart Nameserver 4.4.4.4 # Replace with your nameserver ip Nameserver 8.8.8.8 # Replace with your nameserver ip Next edit nf file by opening it with a text editor such as nano or vi: # vi /etc/nf Other settings should have already been predefined. You will only need to edit the settings for: In that file make the following changes: DEVICE="eth0" Verify the log file entry by using the tail command to display the most recent entries in the /var/log/messages log on the local server: tail /var/log/messages. ![]() Run the following command to generate an entry: logger Test. You can find your network interface name with ifconfig -a command. The logger command is used to manually create a log file entry. Note: Make sure to open the file corresponding to your network interface. Next open: # vi /etc/sysconfig/network-scripts/ifcfg-eth0 Let’s start with the first file: # vi /etc/sysconfig/network If your interface is named “ eth1" then the file that you will need to edit is "ifcfg-eth1". Where in the above "ifcfg-eth0" answers to your network interface eth0. etc/sysconfig/network-scripts/ifcfg-eth0 To configure static IP address in RHEL / CentOS / Fedora, you will need to edit: /etc/sysconfig/network This article is meant to show you how to configure static IP address on most frequently used Linux distributions.įor the purpose of this tutorial, we will use the following Internet Protocol version 4 (IPv4) details: IP address: 192.168.0.100Ĭonfigure Static IP Address in RHEL/CentOS/Fedora: This book, which is one of the most successful to come from the Linux Documentation Project and. Read Also: How to Set or Change System Hostname in Linux ![]() Unlike desktop machines where you can use dynamic IP addresses, on a server infrastructure, you will need to setup a static IP address (at least in most cases). If you are a Linux system administrator, time will come when you will need to configure networking on your system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |