Slackware 10.2 IP aliasing issue
I've done a ton of Google searches, seems like just about as many searches here and other linux forums and I don't seem to be really getting anywhere trying to make a reboot persistent IP alias for eth0:1. I've found what appears should be doing the job. (/etc/rc.d/rc.inet1 and /etc/rc.d/rc.inet1.conf)
I've edited the rc.inet1.conf: Code:
# Config information for eth0: Code:
eth0 Link encap:Ethernet HWaddr 00:03:47:1B:D9:36 Code:
SIOCSIFFLAGS: Cannot assign requested address Yet from a shell prompt from within KDE X-Windows it assigns eth0:1 just fine. At the console if I run the commands, /etc/rc.d/rc.inet1 stop and /etc/rc.d/rc.inet1 start, it also correctly assigns eth0:1. Code:
eth0 Link encap:Ethernet HWaddr 00:03:47:1B:D9:36 |
rc.local
Why don't you put the command to configure the alias in rc.local?
/sbin/ifconfig eth0:1 192.168.0.152 netmask 255.255.255.0 up Another question. What's the use of two interfaces with both addresses in the same network? |
Quote:
Quote:
|
Have you looked at rc.inet1? Restart is simply stop start. Chances are everything isn't taken down before start is trying to bring it back up.
As root edit rc.inet1 and within the restart option between stop start; add as a new line without " "sleep 4". |
Thanks PDock, that helped. Now all I have left is the question I initially started with, how to get an IP alias for a single NIC that's persistent across reboots. So far that's only been achievable by adding the ifconfig command into the rc.local file.
|
Don't think it will work but........
Looks like the rc.inet1 script adds the array number as a suffix to the IFNAME[x] so try changing in rc.inet1.conf IFNAME[1] = "eth0:" also DEBUG_ETH_UP="yes" good luck no warranties offered |
You're right, it didn't work but it was well worth a shot.
|
hi there
i'm searching exactly for the same thing :) (assign 2 ip address at boot time to only one eth whitout ifconfig) i've figure it out that the things you said in the first post are working quite well, and thanks for that :) but the problem we have, is that /etc/rc.d/rc.inet1 doesn't know how to bring up eth0:1 first and then assign the ip, i think that the first time tries to assing the ip, and then bring eth0:1 up that's why we have that error "SIOCSIFFLAGS: Cannot assign requested address" because i think it's the same error you get when you try to assign with rc.inet1 an ip to eth3 for example that is not up, and also that's why when you restart inet1 after boot, and eth0:1 is up,it assign correctly whitout any errors. so the problem is with rc.inet1 and we have to find it where, but i don't want to mess it up :) because i'm some kind a rookie :) so i ask somebody else to be kind to look for this problem :) my configs are: Code:
# Config information for eth0: Code:
/etc/rc.d/rc.inet1 restart |
IP Aliasing
Quote:
You can't put that command in rc.local. Aliasing won't work from rc.inet1 and you'll run rc.inet1 again to no avail. The only way I know aliasing works is putting the proper command in rc.local, e.g., "/sbin/ifconfig eth0:1 192.168.100.100 netmask 255.255.0.0 up". It works, because rc.local runs after rc.inet1 have configured the real network interface. Good luck! |
Quote:
If there are other methods, they are just sugarcoated ways of doing the same thing. I believe future versions will use iproute2 to bring up the interfaces though. |
you can put anything in rc.local, i'm just restarting rc.inet1 just after the boot, what's wrong in that? rc.inet1 starts normally, rc.local follows and then point the rc.inet1 restart.. what's so wrong in that? :)
|
Quote:
There's nothing wrong with using rc.local. My point was that even if you don't use rc.local, you'll end up using the same code to activate the interface anyway (i.e. with ifconfig) |
It should work in Slackware 11.0.
From the changelog: "The network setup script /etc/rc.d/rc.inet1 has been extensively rewritten (...) One that didn't get listed yet that I'll mention here is support for IP aliasing. This sort of thing should work now for setting static IP aliases: IFNAME[2]="eth0:1"" |
Small addition
Quote:
Regards, Danny. |
All times are GMT -5. The time now is 11:09 PM. |