Today's Question:  What weekend projects have you created?        GIVE A SHOUT

Technical Article => Operating System =>  Linux/Unix

Configure static IP for Linux

  sonic0002      2017-07-08 08:39:58      999    0

When a Linux server is running, it has to have an IP so that other machines can talk to it. It is often desired that the server would own a static IP so that every time other machines want to connect to it, the same IP address would be used. This is extremely useful when there are virtual machines installed on a host machine where the virtual machine would start and stop now and then. 

To configure static IP address for a Linux server, the /etc/network/interfaces needs to be updated. Assuming there is a host only network is created for a network interface named eth1. The configuration would look like

auto eth1
iface eth1 inet static

Here the interface for eth1 needs to be defined with static specified. This means this will be a static IP. Other options are available as well such as dhcp and loopback

Next, need to specify the IP address to be configured. This will be the IP address other machines would connect to. Thereafter, some standard configuration should be defined such as netmask, gateway, dns-nameservers etc. But the address is the most important one.

After saving this configuration, the changes could be applied by running below commands.

  1. Login as root or a user with sudo privilege
  2. Run sudo ifdown eth1 to bring down the desired network interface
  3. Run sudo ifup eth1 to bring up the desired network interface

Now check the whether the configuration takes effect using ifconfig -a command.


Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious



No comment for this article.


What is VBA?

By sonic0002
This is a conversation on Google product forum. Google engineers really don't know what is VBA? Or they just refuse to acknowledge the existence of VBA? The full conversation can be found at!topic/chrome/zY-8vP1lIys