≡ Menu

network configuration

Linux Is Supposed To Be Easy?

Linux is extremely powerful, robust and flexible, which means it must have a significant amount of complexity. Do you think I learnt everything in a day? I don't know who told you Linux was easy, many times other people make it harder than it has to be by thinking they need to understand everything at once.

Some Preliminary Advice

Some recommendations I would give you before you began with Linux:

  • Take it easy. Frustration makes things worse for everyone.
  • Never try anything for the first time in a production environment. Always use test environment. For example, iptables firewall or complex security configurations. Always use a test computer or virtual machine to test the various applications, configurations and settings. It will save lots of time. Recommended virtualization software - Vmware or Xen or VirtualBox
  • Another option is start your journey with with LiveCDs. See the list of all Linux, BSD, LiveCDs and LiveDVDs here.
  • Always refer to hardware compatible list (HCL) and kernel source documentation directory (/usr/src/linux/Documentation/) to check your hardware compatibility.
  • Learn to read and search command man pages and vi / vim text editor. Type vimtutor at a shell prompt. The Vimtutor is useful for people that want to learn their first Vim commands.
  • Don't try to set or create ultra secure servers / services on your first shot. Mess with test system couple times i.e. play for a while until you understand everything. Don't stress out for the perfect solution, it will slow you down.
  • Stay away from advanced stuff until you learn the basic stuff like, ssh, vi text editor, directory structure, log files, searching and greping files, network configuration, package management, patch management, troubleshooting techniques using host, ping, route, ifconfig and other tools.
  • Learn regex and text utilities such as sed, awk, grep and others. It will save lots of time in a long run.
  • Learn to customize your own login environment. This will give you good idea about many configuration options such as ftp, vi, Gnome, Kde, GUI tools and much more. Get a good Linux book, it will be a big help (see below for recommend books).
  • Don't hesitate to ask your questions on the forums and mailing lists. Also help others in the forums when you can. You will be supervised to find out how explaining stuff to someone else helps you understand it better.
  • Learn to automate stuff using shell scripts.
  • When you run into a problem with a configuration, make sure you read:
    • The man pages
    • The info pages
    • Read package README.txt, INSTALL.txt and other files stored in a current directory or /usr/share/doc/package-name directory.
  • Use google / yahoo search engines to do several searches with different terms. My personal experience you may get answer in the forums / websites / mailing lists. Only rarely have my problems not already been answered in the forums.
  • Subscribe to security alert mailing lists.
  • Learn to compile packages using make, configure and other build tools.
  • Once you learnt terminology and basic things, start configuring basic services such as Apache. They idea is simple start by getting something up and visible. Take a time to explore stuff and get comfortable with each service / servers. Always configure one service at a time and get familiar with them one at a time.
  • Don't compare Windows utilities / software with equivalent Linux software. Windows is not Linux or vise versa.
  • Don't try to replace Windows desktop with Linux desktop. Windows desktop has better applications stack. Similarly, Windows can't replace Linux. You need to consider various factors before migrating from Windows systems.
  • Gather experience.
  • Finally, always ignore flame wars such as 'vim vs emacs editor' or 'BSD vs Linux'.

Good Luck!

References / Recommend Readings:

Q. I am using Ubuntu Linux and I would like to know how to create alias for eth0 so that I can have multiple IP address?

A. 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:

gksudo gedit /etc/network/interfaces

OR

sudo vi /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).

See also:

Howto: Performance Benchmarks a Webserver

You can benchmark Apache, IIS and other web server with apache benchmarking tool called ab. Recently I was asked to performance benchmarks for different web servers.

It is true that benchmarking a web server is not an easy task. From how to benchmark a web server:

First, benchmarking a web server is not an easy thing. To benchmark a web server the time it will take to give a page is not important: you don't care if a user can have his page in 0.1 ms or in 0.05 ms as nobody can have such delays on the Internet.

What is important is the average time it will take when you have a maximum number of users on your site simultaneously. Another important thing is how much more time it will take when there are 2 times more users: a server that take 2 times more for 2 times more users is better than another that take 4 times more for the same amount of users."

Here are few tips to carry out procedure along with an example:
[click to continue…]