PDA

View Full Version : [ubuntu] Adding virtual ip in Ubuntu 11.10



call_krushna
November 8th, 2011, 07:28 PM
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


(http://www.linuxquestions.org/questions/report.php?p=4518990)

bluexrider
November 8th, 2011, 07:56 PM
Did you uninstall your network manager?


add virtual IP the easy way
http://www.liberiangeek.net/2010/02/creating-virtual-ip-addresses-in-ubuntu-the-easy-way/

call_krushna
November 9th, 2011, 12:38 PM
Sorry to say this,

I have already followed the url earlier and it was working with Ubuntu 10.04. Problem started with 11.10 .Sorry for posting the stupid question .but I am not able to get solution around .

chakhedik
December 6th, 2011, 08:09 AM
Hi,

I face exactly the same problem with ubuntu 11.10...it works fine with 11.04 then it failed tu bring up after upgrade to 11.10...have you found the workaround?

flickerfly
December 8th, 2011, 10:06 PM
This link looks like it has relevant information:
http://www.linuxquestions.org/questions/linux-networking-3/rtnetlink-answers-file-exists-error-when-doing-ifup-on-alias-eth1-1-on-rhel5-710766/

I've found that even though I can't see the virtual NICs they are responding. In that link, the OP mentions "Further read indicated there is an option for alias files to start the alias interface at same time as primary or not. The default is to start at same time." Anyone have a clue how to change that?

call_krushna
December 14th, 2011, 04:05 PM
Hi,

I face exactly the same problem with ubuntu 11.10...it works fine with 11.04 then it failed tu bring up after upgrade to 11.10...have you found the workaround?


Hi chakhedik (http://ubuntuforums.org/member.php?u=996901)

Still I am waiting for solution .

SeijiSensei
December 14th, 2011, 04:26 PM
This is a known bug in 11.10 (https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/876829).

You could create the interface manually in /etc/rc.local. Remove the definition in /etc/network/interfaces, then edit /etc/rc.local and add this command:



ifconfig eth0:0 192.168.0.41 netmask 255.255.255.0 broadcast 192.168.0.255

You don't need a gateway directive; the aliases always use the same gateway as the physical adapter.

flickerfly
December 14th, 2011, 04:55 PM
That report says a fix was released last month, but I'm still having the problem. When should we expect that to trickle into the repos?

chakhedik
December 16th, 2011, 10:21 PM
This is a known bug in 11.10 (https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/876829).

You could create the interface manually in /etc/rc.local. Remove the definition in /etc/network/interfaces, then edit /etc/rc.local and add this command:



ifconfig eth0:0 192.168.0.41 netmask 255.255.255.0 broadcast 192.168.0.255You don't need a gateway directive; the aliases always use the same gateway as the physical adapter.

thanks SeijiSensei, that solve my problem....thank you very much :D



That report says a fix was released last month, but I'm still having the problem. When should we expect that to trickle into the repos?i think the fix released for debian only and not yet been pushed to ubuntu....

call_krushna
December 22nd, 2011, 05:54 PM
This is a known bug in 11.10 (https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/876829).

You could create the interface manually in /etc/rc.local. Remove the definition in /etc/network/interfaces, then edit /etc/rc.local and add this command:



ifconfig eth0:0 192.168.0.41 netmask 255.255.255.0 broadcast 192.168.0.255You don't need a gateway directive; the aliases always use the same gateway as the physical adapter.

Thanks a ton SeijiSensei (http://ubuntuforums.org/member.php?u=698195) for the solution .This resolved my problem .I was about to downgrade OS .Sorry for late reply .

call_krushna
December 22nd, 2011, 06:00 PM
Thanks a lot .