We have a server (a router) with 5 IP addresses (we are hosting different Websites).
I'm wondering why the server was setup like that:
-> eth1 is connected to the modem
-> when the connection is established, then "ppp0" is created
-> there is a script in /etc/ppp/ip-up.d/2publicips:
ifconfig eth2 163.88.0.25 netmask 255.255.255.248
ifconfig eth2:0 163.88.0.26 netmask 255.255.255.248
ifconfig eth2:1 163.88.0.27 netmask 255.255.255.248
...
Everything is working correctly. I'm just curious why it was setup like that.
My question: Is that the correct way to setup a server with multiple IPs?
why using "eth2" for the extra IP adresses? Because of this, we can't plug any cable in eth2. Why not using "ppp0:1, ppp0:2..." or "eth1:1, eth1:2..."?
Unfortunately the person who setup this server is not here anymore.
I'm not so familiar with multi-homing.
Presumably you are using PPPoE, which explains why eth1 is connected to the modem.
When the PPP session is established, pppd will invoke the various scripts in the ip.up.d as you mentioned.
The
ifconfig
commands that you show are an entirely reasonable way to set up an IP alias.The most logical reason why multiple IP addresses are used is for when name-based virtual-hosting is not feasible (https being the most obvious example clasically, as -- prior to SNI support being reliably present -- you don't know which SSL certificate to present as the Host HTTP header hasn't been seen yet).
I'm also assuming that the 'router' is doing double-duty (or was at some time) as a server -- not necesarily an HTTP server.