shaerzzr 发表于 2018-5-19 06:52:42

Linux IP Alias

  1. Abount IP Alias
      IP alias / IP aliasing is assigning multiple IP addresses to a single physical network interface. Alias network interface is configured on top of existing physical network interface.
  

      By IP aliasing we can make applications and services running on linux server available on multiple IP addresses by using only one physical network interfase.
  

      Requirements for IP alias
        * Physical Network Interface Connectivity
        * Available Multiple IP Addresses
  

      Limitations of IP alias:
              * Subnet Aliasing (alias network interface IP address is preffered to be in the same network subnet as physical network interface below – if not proper network infrastructure configuration is needed)
      * DHCP (alias interfaces do not support DHCP)
  

  

  Example: nic eth0 192.168.1.100
  

  2. Non-Persistent IP Alias Configuration
  

  $ ifconfig eth0:0 192.168.1.100 up
  

  3. Persistent IP Alias Configuration
  $ cat /etc/sysconfig/network-scripts/ifcfg-eth0
  DEVICE=eth0
  TYPE=Ethernet
  ONBOOT=yes
  NM_CONTROLLED=no
  BOOTPROTO=none
  IPADDR=192.168.1.100
  PREFIX=24
  GATEWAY=192.168.1.1
  DNS1=114.114.114.114
  IPV4_FAILURE_FATAL=yes
  IPV6INIT=no
  NAME="System eth0"
  

  $ cat /etc/sysconfig/network-scripts/ifcfg-eth0\:0
  DEVICE=eth0
  TYPE=Ethernet
  ONBOOT=yes
  NM_CONTROLLED=no
  BOOTPROTO=static
  ONPARENT=yes
  IPADDR=192.168.1.101
  PREFIX=24
  IPV4_FAILURE_FATAL=yes
  IPV6INIT=no
  NAME="System eth0:0"
  
页: [1]
查看完整版本: Linux IP Alias