Linux / FreeBSD: Multiple IP Addresses on One Interface

Q. Can one Linux / BSD system respond to multiple IP address on a single Ethernet interface? I need to run multiple web sites and mod_ssl with a single server. How do I configure my box for multiple IP address?

A. Linux / UNIX and BSD like operating systems supports multiple IP address on a single interface using a feature called ip aliasing. You can add extra IP addresses with the ifconfig command. However, I recommend modifying configuration files so that operating system remember all ips after reboot.

ADVERTISEMENTS

See our previous FAQ and How-tos about IP aliasing:

  1. FreeBSD Setup 2 IP address on One NIC ( IP alias )
  2. How to bind a range of IP’s in Debian / Ubuntu Linux
  3. Red Hat / CentOS / Fedora Linux add multiple IP address
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • Viking May 2, 2008 @ 19:55

    Hi,
    it appears that You don’t have to have multiple ip’s to achieve this.You can do pretty much the same using TLS Extensions.Take a look:

    Link

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.