LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-16-2008, 10:22 AM   #1
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
Trouble with alias IP on Debian 4


I have several static IP addresses and have one assigned to my Debian 4 machine. This machine has 2 NICs. eth0 is the local network (192.168.0.1/24) and eth1 is the public IP (we'll say 204.87.256.58/29 - yes, I know this is an invalid IP address....). Currently .58 is assigned to eth1 and works. I wanted to add a second IP and edited my /etc/network/interfaces file to reflect this:

auto eth1
iface eth1 inet static
address 204.87.256.58
netmask 255.255.255.248
network 204.87.256.56
broadcast 204.87.256.63
gateway 204.87.256.57
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 256.55.140.11 70.260.207.137
dns-search mydomain.com

auto eth1:0
iface eth1:0 inet static
address 204.87.256.59
netmask 255.255.255.248
gateway 204.87.256.57


Now when I restart the service (/etc/init.d/networking restart) the new IP shows, but I cannot ping it from outside - maybe my firewall, but we'll get to that next. I run 'ifconfig eth1:0 down', and then try to brin it back up with 'ifconfig eth1:0 up' but get this error:

mc1:/etc/network# ifconfig -v eth1:0 up
SIOCSIFFLAGS: Cannot assign requested address
WARNING: at least one error occured. (-1)

This IP USED to be assigned to a Redhat box, but I've since given it a new IP so this one was open. Can anyone see where I went wrong or fat-fingered something?
Thanks.
 
Old 01-17-2008, 07:14 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
I am not sure you can assign a gateway on Alias IPs. I think the Alias IP scheme handles that for you. Just never done this on a Debian system. Only Redhat machines.

Brian
 
Old 01-17-2008, 08:26 PM   #3
digen
Member
 
Registered: Dec 2005
Location: India
Distribution: Ubuntu Feisty Fawn
Posts: 107

Rep: Reputation: 15
I just tried this in a Ubuntu virtual machine inside Parallels. Though I was able to turn the virtual alias interface down. Trying to start it using ifconfig eth0:0 up yields,


Quote:
digen@postfix:~$ sudo ifconfig eth0:0 up
SIOCSIFFLAGS: Cannot assign requested address
 
Old 01-17-2008, 09:29 PM   #4
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
Same problem I'm getting.
Works fine on my RH machine tho.
 
Old 01-19-2008, 02:43 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Maybe this quick google hit might help.
http://www.cyberciti.biz/faq/bind-al...ress-in-linux/

Brian
 
Old 01-20-2008, 12:16 AM   #6
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Brian1 View Post
Maybe this quick google hit might help.
http://www.cyberciti.biz/faq/bind-al...ress-in-linux/

Brian
Tried that. That's what my interfaces file looks like (with different IP addresses of course). Bringing interface down then back up gives the error about not being able to assign the address.
 
Old 01-20-2008, 01:35 AM   #7
javaroast
Member
 
Registered: Apr 2005
Posts: 131

Rep: Reputation: 19
You can try by skipping the alias and using:
ip addr add 204.87.256.59/29 dev eth1

This will assign multiple IP's to the outside interface. Definitely make sure to include this in the firewall rules.
 
Old 01-20-2008, 11:28 AM   #8
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by javaroast View Post
You can try by skipping the alias and using:
ip addr add 204.87.256.59/29 dev eth1

This will assign multiple IP's to the outside interface. Definitely make sure to include this in the firewall rules.
The command returned no erros, but the extra IP did not show in ipconfig, nor can I ping it (I'm accepting ICMP traffic on the other IP assigned to eth1, so I assume that the new IP would be blanketed as well).
Thanks though!
 
Old 01-20-2008, 05:01 PM   #9
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
Maybe it's my NIC? Maybe it doesn't support alias addresses? (I'm shooting in the dark here)
 
Old 01-20-2008, 09:36 PM   #10
javaroast
Member
 
Registered: Apr 2005
Posts: 131

Rep: Reputation: 19
Try using ip addr to see if you can see the IP. You should also check your firewall logs to see if it is blocking your attempts to connect.
 
Old 01-21-2008, 07:24 AM   #11
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by javaroast View Post
Try using ip addr to see if you can see the IP. You should also check your firewall logs to see if it is blocking your attempts to connect.
The IP shows there, but not under ifconfig.
I'll work on the firewall later this week and get back to you.
Thanks!
 
  


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
IP alias? Machine name alias? JohnLocke Linux - Newbie 4 01-16-2008 01:21 PM
trouble creating alias coldbeerz Linux - Newbie 4 11-19-2007 11:37 AM
rt2500 Wireless Lan Card Debian Sid AMD64 -- alias problem rickh Debian 3 01-27-2006 11:40 PM
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 01:40 AM
HELP Debian 3 (woody) wont ip alias 80s Linux - Distributions 1 05-10-2003 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration