IP aliases configuration With the evolution of the _I_n_t_e_r_n_e_t and the power of the microcomput- ers, it is now possible and useful for a computer to act as many, by putting several servers in one box. The trick to achieving this is to let the machine respond to more than one IP number. We call these IP aliases. 11.. DDeeffiinniinngg aalliiaasseess IP aliases are referred to this way because they are alternative IP numbers for a network device. Some software packages can use alternate configurations based on the target IP number of a request. Web (httpd) servers and the virtual POP e-mail server distributed with Linuxconf are the most notable examples. An alias is associated with a network device. Linuxconf provides you with a list of active network devices (aliases can only be defined for active devices). Although any active device may be chosen, it is often simpler to pick one of the Ethernet devices (eth0) of the computer. Furthermore, using IP numbers originating from the same network number as the primary IP number of the device will simplify routing. You don't have to tell any other machine on the network about what you're doing. It just works. If you pick IP numbers unrelated to the network of the Ethernet device, you will need to define special routing on the other hosts of the network. Your server will look like a gateway to a "virtual network." This is often done in practice when you need a huge amount of aliases, exceeding the available numbers on the local network. Once you have selected a network device, you are taken into a simple dialog with many empty lines. Just enter the aliases (IP numbers) you wish to associate with this device. If you need more empty lines, use the _A_d_d button. 22.. UUssiinngg nnaammeess _L_i_n_u_x_c_o_n_f initializes the IP aliases well after the basic networking, so at this point, the DNS is fully reachable. You can safely use names to define aliases instead of just IP numbers. This is useful if you have a few disparate (unrelated) aliases to define. 33.. DDeeffiinniinngg rraannggeess Big Internet _W_e_b servers host several "virtual domains." While we can define one alias per virtual Web server, it is much easier to allocate a range of IP numbers and map the virtual servers into that range. See the "IP allocation space" of the _D_N_S _c_o_n_f_i_g_u_r_a_t_o_r section of _L_i_n_u_x_c_o_n_f. You can define, for example, fifty IP aliases just by entering a single line in the dialog, such as the following entry: 192.168.1.1-50 44.. HHooww mmaannyy aalliiaasseess ccaann LLiinnuuxx hhaannddllee?? Linux 2.0 handles 256 aliases per device. Since Linux 2.0.31 there has been and continues to be a soft limit on the kernel table used to store the aliases. The limit is set to 256 at boot time. This limit may be changed by writing a new value in the file /proc/sys/net/core/net_alias_max But there is a small catch -- this new limit only becomes active when you set the first alias of a device. If there are already IP aliases on a network device, they will have to be unset. When there is no alias on a device, the table is deleted and it will be recreated with the new limit the next time you set the aliases. _L_i_n_u_x_c_o_n_f handles all this for you and will unset some aliases before attempting to grow the table. Some messages are sent to the log explaining this. So Linux can handle a lot of aliases. 55.. AA sstteepp bbyy sstteepp eexxaammppllee Here is a example of how to set up one IP alias and help to create a new one easily. 55..11.. FFiirrsstt,, aallllooccaattee aa bbuunncchh ooff aalliiaasseess In the IP alias dialog, define a full range of IP aliases. This will likely be sufficient for quite some time. Suppose your eth0 network is 192.168.1.0 and there is an unused section. Just enter 192.168.1.50-100 which will allocate 51 IP aliases for future use. 55..22.. TTeellll tthhee DDNNSS aabboouutt tthhiiss Now, in the "Configure domain name server" menu, you select the "IP allocation space" entry. Enter the range and a small description such as "Virtual domains." The DNS is not always on the same machine where you define the IP aliases. 55..33.. EEaacchh ttiimmee yyoouu aallllooccaattee aa nneeww vviirrttuuaall WWWWWW ddoommaaiinn Go into the DNS and add a host for the domain, generally www.new_domain. For the IP number, hit ctrl-X and Linuxconf will compute the first unused IP number in the IP aliases range. Pick this number. Then go into the httpd configuration and add a section for the new www domain. Repeat this step for each new domain until you are out of IP aliases. Using this strategy (defining a bunch of aliases first, telling the DNS about them next, and using them last), you will avoid many errors.