In my current CentOS ifconfig, I have eth0
and the range of virtual interfaces eth0:0 - eth0:3
each taking up a unique address in the subnet 69.xx.yy.194/29
(gateway = .193
, broadcast = .199
)
Now I only get one shot at this because I access the server via remote terminal, so I thought I'd ask here to double check what I'm about to do.
I'm guessing if I perform ifdown eth0
, it will take everything, including the interfaces down. What I would like is to be able to take down any one of my 5 services running on the machine by plugging them each into their own virtual interface (note, I only have 4 interfaces right now)
Therefore, is it possible to not have an IP address assigned to eth0
, and rather put it on eth0:0
so I end up with 5 interfaces each with a separate address?
(Will this have unexpected side-effects for my PuTTY connection?)
You're correct that taking down eth0 will take down all cirtual interfaces based on eth0.
Instead of taking the interface down, you could reconfigure it with the address 0.0.0.0 - this will keep the interface up but without an IP address. I just verified that the following sequence worked perfectly:
The server originally has the address 172.17.8.10 on eth0, default gateway is 172.17.8.1
When you're doing this, it's highly likely that your SSH connection will be interrupted. I would start by SSH:ing to one of the virtual interfaces; as long as you don't do
ifcfg eth0
down, that session should not be interrupted.I would also advice you to setup an at job or cron job that resets all interfaces to their previous state after 5 minutes. If your new setup works, you can cancel the at job, but if it doesn't, you'll be able to get back in after a few minutes.