LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 10-25-2010, 04:39 AM   #1
nonshatter
Member
 
Registered: Aug 2010
Location: Hants
Distribution: SLES, Ubuntu, Centos
Posts: 41

Rep: Reputation: 0
/etc/network/interfaces configuration for virtual interfaces


Hey,

I've just been trying to create a virtual address on the same interface.

I need one static address for the internet, and another (virtual) static IP for mysql server running on 9.0.0.10

Here is my /etc/network/interfaces configuration:
Code:
auto lo
iface lo inet loopback
auto eth0 eth0:0

iface eth0 inet static
        address 10.0.54.127
        netmask 255.255.252.0
        gateway 10.0.52.1
iface eth0:0 inet static
        address 9.0.0.10
        netmask 255.0.0.0
        gateway 10.0.52.1
eth0 seems fine, but eth0:0 doesn't come up when the networking is restarted. I get "SIOCSIFFLAGS: Cannot assign requested address" and "Failed to bring up eth0:0"

Any ideas what's wrong here?

Many thanks

Last edited by nonshatter; 10-25-2010 at 05:31 AM.
 
Old 10-25-2010, 05:53 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Try this command and see if it works:

Code:
sudo ifconfig eth0:0 9.0.0.10  up
 
Old 10-25-2010, 06:02 AM   #3
nonshatter
Member
 
Registered: Aug 2010
Location: Hants
Distribution: SLES, Ubuntu, Centos
Posts: 41

Original Poster
Rep: Reputation: 0
Hi thanks for the reply, Here's the response I get

Code:
# sudo ifconfig eth0:0 9.0.0.10 up
SIOCSIFADDR: File exists
SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
I can't see a problem with my interfaces configuration, and can't seem to narrow down where the issue resides. Are there any other config files that I could check?

I've also tried this:
Code:
# ip addr sh eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 100
    link/ether 00:25:90:0a:96:7c brd ff:ff:ff:ff:ff:ff
    inet 10.0.54.127/22 brd 10.0.55.255 scope global eth0
    inet 9.0.0.10/8 brd 9.255.255.255 scope global eth0
    inet6 fe80::225:90ff:fe0a:967c/64 scope link
       valid_lft forever preferred_lft forever
and the mysql address is there, but it still won't let me connect :s

Last edited by nonshatter; 10-25-2010 at 06:03 AM.
 
Old 10-25-2010, 06:15 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
and what about

Quote:
sudo ifconfig eth0:0 10.0.54.130 up
or

Quote:
sudo ifconfig eth0:1 10.0.54.130 up
 
Old 10-25-2010, 06:22 AM   #5
nonshatter
Member
 
Registered: Aug 2010
Location: Hants
Distribution: SLES, Ubuntu, Centos
Posts: 41

Original Poster
Rep: Reputation: 0
Okay, I've solved the problem. The configuration was all okay. Why it wouldn't let me assign the address under /interfaces was because the address already existed under the kernels routing table.

MySQL was refusing the connection because /etc/mysql/my.cnf was only listening to connections from localhost.

Code:
bind-address = 127.0.0.1
was changed to listen to the virtual interface. I restarted mysql and hey presto, it works!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual network interfaces.... info please! resetreset Linux - Networking 3 04-02-2010 03:09 AM
Virtual Network Interfaces - What is it suitable for? Orangutanklaus Linux - Networking 2 10-08-2009 04:41 AM
Slackware and virtual network interfaces... jademan83 Linux - Networking 4 08-23-2007 06:27 PM
Virtual network interfaces that use dhcp titakker Linux - Networking 1 09-23-2003 12:10 AM
Virtual Network Interfaces pickledbeans Linux - Networking 1 07-11-2002 09:08 AM


All times are GMT -5. The time now is 09:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration