Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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:
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.
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
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.