LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding virtual ip in Ubuntu 11.10 (https://www.linuxquestions.org/questions/linux-newbie-8/adding-virtual-ip-in-ubuntu-11-10-a-912503/)

call_krushna 11-08-2011 11:48 AM

Adding virtual ip in Ubuntu 11.10
 
Hi Everybody,

I want add virtual ip for my pc(Ubuntu 11.10).I have edited the file
#vi /etc/network/interface and added the below line

auto eth0
iface eth0 inet static
address 192.168.0.190
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.8
auto eth0:1
iface eth0:1 inet static
address 192.168.0.41
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.8

But while restarting the network service gives the below error

Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces... RTNETLINK answers: File exists
Failed to bring up eth0:1.


Any suggestion highly appreciated .

Thanks in advance

jmc1987 11-08-2011 12:11 PM

http://www.liberiangeek.net/2010/02/...-the-easy-way/

This should work. Now I can exactly remember but I think they say remove the network manager because it will keep overiding and make things a pain if I don't recall. So trial and error is all I can say at this moment.

call_krushna 11-08-2011 12:51 PM

Hi Jmc1987,

I have already followed the Url .This did not help me. I was working fine with Ubuntu 10.04 .After installing Ubuntu 11.10,Its giving the problem .

jmc1987 11-08-2011 02:14 PM

have you confirmed your card is recognized?

Quote:

# lspci |grep Ethernet
$ ifconfig -a |grep eth
Are you able to connect my adding the ips over the cli such as
Quote:

# ifconfig eth0 192.168.0.190 netmask 255.255.255.0 up
# route add default gw 192.168.0.8
Can you get your card working with the network-manager?

call_krushna 11-09-2011 04:51 AM

Hi Jmc1987,

There is no problem with detecting eth0. With dhcp client , I am able to get ip from DHCP server and access internet .Problem comes when I am editing the file(/etc/network/interface) for virtual ip .Is it a bug with Ubuntu 11.10 :( .The same way I used to edit in Ubuntu 10.04 and it was working fine all these days.Looking forward for a solution .


Thanks

call_krushna 11-12-2011 03:27 AM

No solution for the problem ?

jmc1987 11-12-2011 10:51 AM

Have you tried using the network-manager to connect with a static ip?

trafficbroker 11-12-2011 09:22 PM

I have the same problem with eth0/:1 on Ubuntu Server 11.10.

eth0 works fine, ifup eth0:1 throws the same error mentioned by the op. I tried all suggestions.

did somebody have the same issue and solved it?

call_krushna 12-20-2011 05:22 AM

Hi Everybody,

I am struggling alot to fix the issue .Anybody able to resolve the issue ???

call_krushna 12-22-2011 11:01 AM

Hi trafficbroker,

Here you go .Delete the entries from /etc/network/interface and add the below line in /etc/rc.local

ifconfig eth0:1 x.x.x.x netmask 255.255.255.x broadcast x.x.x.x .



Note :- Replace x with ip ,netmask and broadcast details


All times are GMT -5. The time now is 10:04 AM.