Multiple IP Addresses on debian linux

/etc/network/interfaces 설정

  1. device IP를 여러개 할당할 수 있다.
    # The primary network interface
    auto eth0
    iface eth0 inet static
        address <the outbound IP>
        netmask <the netmask for the outbound IP, usually 255.255.255.0>
        gateway <the gateway for the outbound IP, find it in Linode Manager - Remote Access>
        up /sbin/ip addr add <the primary IP>/24 dev eth0
  2. eth0 인터페이스에 메인아이피가 192.168.200.101로 할당되어 있고 192.168.200.102 를 추가로 할당한다.
    auto eth0
    iface eth0 inet static
           address 192.168.200.101
           netmask 255.255.255.0
           gateway 192.168.200.1
           up /sbin/ip addr add 192.168.200.102/24 dev eth0