Showing posts with label #Perfect server set up. Show all posts
Showing posts with label #Perfect server set up. Show all posts

25 July, 2015

Ubuntu Linux: Creating ethernet alias for eth0 network device

 how to create alias for eth0 so that I can have multiple IP address?

To create alias for eth0 use ifconfig command. 
It is use to configure a network interface and aliases.

Assuming that your eth0 IP is 192.168.1.10 
and you would like to create an alias eth0:0
with IP 192.168.1.11.
Type the following command:

#sudo ifconfig eth0:0 192.168.1.11 up

or
#sudo /sbin/ifconfig eth0:0 192.168.1.11 up

Verify that alias is up and running using following two command(s):

#/sbin/ifconfig
#ping 192.168.1.11
#ping your-getway-ip

 

Permanent configuration

Your ethernet configuration is located in a file called /etc/network/interfaces.
If you reboot system you will lost your alias.
To make it permanent you need to add it network configuration file:

#sudo nano /etc/network/interfaces

on Debian as root:
# nano /etc/network/interfaces

Append the following configuration:

auto eth0:0
iface eth0:0 inet static
name Ethernet alias LAN card
address 192.168.1.11
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0

Save the file and restart system or restart the network:

#sudo /etc/init.d/networking restart

Please note that you can also use graphical tools located at  
System > Administration > Networking menu. 
Or use the following GUI tool to setup aliases, hostname, dns settings etc:

#sudo network-admin

If you want more network aliases, use eth0:1, eth0:2, eth0:N (max upto 254).

#Perfect Server Setup

TIME synchronize on server with NTP

Synchronize the System Clock

It is a good idea to synchronize the system clock with an 
NTP (network time protocol) server over the Internet. 

Simply run

#apt-get install ntp ntpdate

and your system time will always be in sync.



#Perfect server set up

how to prevent laptop from sleeping when closing lid ?

Stop Going to Sleep When Closing the Laptop

#how_to_disable_lid_on_laptop_in_terminal

  • Open Terminal
  • type in the command below (as root)

sudo gedit /etc/systemd/logind.conf
  • Now the logind.conf file will open in Gedit text editor
  • set the variable “HandleLidSwitch” to “ignore”, as in the example below:
 
[Login]
 #NAutoVTs=6
 #ReserveVT=6
 #KillUserProcesses=no
 #KillOnlyUsers=
 #KillExcludeUsers=root
 #Controllers=
 #ResetControllers=cpu
 #InhibitDelayMaxSec=5
 #HandlePowerKey=poweroff
 #HandleSuspendKey=suspend
 #HandleHibernateKey=hibernate
 HandleLidSwitch=ignore
 #PowerKeyIgnoreInhibited=no
 #SuspendKeyIgnoreInhibited=no
 #HibernateKeyIgnoreInhibited=no
 #LidSwitchIgnoreInhibited=yes
  • Now reboot
With this change, reboot your system and feel free to close your laptop lid that it will no longer go to sleep. Now you are done!
Enjoy!


i'm using that to create server on my Laptop,
less power consumptions and recycle old computer..


#Perfect server set up