load virtual interfaces at boot time
Greetings all, I am trying to set up some virtual interfaces to load at reboot time and I keep failing... Doing it with /etc/sysconfig/network/ifcfg-eth0:1 seems to be deprecated and is not working (I tested it and didn't work for me). /etc/sysconfig/network/ifcfg.template says something about labeling in the /etc/sysconfig/network/ifcfg-id<mac> the two virtual interface, something like IPADDRESS_0, IPADDRESS_1 and so on... Tried that as well and still not working... Can you guys just simply tell me how to easily do this so that I have virtual interfaces loading at boot time after the network interfaces are up? (Cause tried /etc/rc.d/boot.local as well, using ifconfig eth0:1 ... and so on... and is not working since boot.local is ran before interfaces are up... I managed to add the static routes in /etc/sysconfig/network/routes, and here I have a question... the gateway there is the gateway of the server the route is set up on, or the gateway through which that servers goes out on the internet or into the lan? Thank you in advance for your advice. Daniel
On Tuesday 07 September 2004 08:15 am, Daniel Secareanu wrote:
Greetings all,
I am trying to set up some virtual interfaces to load at reboot time and I keep failing... Doing it with /etc/sysconfig/network/ifcfg-eth0:1 seems to be deprecated and is not working (I tested it and didn't work for me). /etc/sysconfig/network/ifcfg.template says something about labeling in the /etc/sysconfig/network/ifcfg-id<mac> the two virtual interface, something like IPADDRESS_0, IPADDRESS_1 and so on... Tried that as well and still not working... Can you guys just simply tell me how to easily do this so that I have virtual interfaces loading at boot time after the network interfaces are up?
Here is what I added to my ifcfg to get a virtual interface... IPADDR_1=192.168.0.100 NETMASK_1=255.255.255.0 BROADCAST_1=192.168.255.255 LABEL_1=1 It probably doesn't matter, but just in case, I did make one other change. Something choked on the ifcfg-id<mac> name. It was too long and got truncated. I renamed the file to ifcfg-eth0 and it worked. I now have an eth0 and an eth0:1 Doug
Doug B wrote:
On Tuesday 07 September 2004 08:15 am, Daniel Secareanu wrote:
I am trying to set up some virtual interfaces to load at reboot time and I keep failing... Doing it with /etc/sysconfig/network/ifcfg-eth0:1 seems to be deprecated and is not working (I tested it and didn't work for me). /etc/sysconfig/network/ifcfg.template says something about labeling in the /etc/sysconfig/network/ifcfg-id<mac> the two virtual interface, something like IPADDRESS_0, IPADDRESS_1 and so on... Tried that as well and still not working... Can you guys just simply tell me how to easily do this so that I have virtual interfaces loading at boot time after the network interfaces are up?
Here is what I added to my ifcfg to get a virtual interface...
IPADDR_1=192.168.0.100 NETMASK_1=255.255.255.0 BROADCAST_1=192.168.255.255 LABEL_1=1
It probably doesn't matter, but just in case, I did make one other change. Something choked on the ifcfg-id<mac> name. It was too long and got truncated. I renamed the file to ifcfg-eth0 and it worked. I now have an eth0 and an eth0:1
I tried these but with no success. To test it, I am doing: rcnetwork restart ifconfig And I only see the originally DHCP assigned IP address and not the supplementary static ones I wish to see there. Simply adding them manually with ifconfig works, but as Daniel mentionned it, it's not as we would like to have it: at boot time. I am putting the config file below for info, just in case there is a mistake in it... TIA! Patrick -- /etc/sysconfig/network # cat ifcfg-eth1 BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' UNIQUE='VCu0.AujCtKsDPG3' _nm_name='bus-pci-0000:01:00.0' BOOTPROTO_1='static' BOOTPROTO_2='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24 LABEL_1=1 LABEL_2=2
On Sat, Sep 11, 2004 at 12:29:31AM +0200, Patriiiiiiiiiick wrote:
I tried these but with no success. To test it, I am doing:
rcnetwork restart ifconfig
Try "ip addr show"
/etc/sysconfig/network # cat ifcfg-eth1 BOOTPROTO='dhcp' ^^^^ MTU='' REMOTE_IPADDR='' STARTMODE='onboot' UNIQUE='VCu0.AujCtKsDPG3' _nm_name='bus-pci-0000:01:00.0'
BOOTPROTO_1='static' ^^^^^^ BOOTPROTO_2='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24 LABEL_1=1 LABEL_2=2
I don't think it is possible to mix dhcp and static on one interface. Regards, -Kastus
Kastus wrote:
On Sat, Sep 11, 2004 at 12:29:31AM +0200, Patriiiiiiiiiick wrote:
Try "ip addr show"
It confirms the addresses are not up.
/etc/sysconfig/network # cat ifcfg-eth1 BOOTPROTO='dhcp' BOOTPROTO_1='static'
I don't think it is possible to mix dhcp and static on one interface.
You might be right but that would astonnish me a lot as it was possible before (SuSE 8.2). I would be surprised that such a thing would have regressed (feature-wise). Patrick
On Friday 10 September 2004 05:29 pm, Patriiiiiiiiiick wrote:
I tried these but with no success. To test it, I am doing:
rcnetwork restart ifconfig
And I only see the originally DHCP assigned IP address and not the supplementary static ones I wish to see there. Simply adding them manually with ifconfig works, but as Daniel mentionned it, it's not as we would like to have it: at boot time.
I am putting the config file below for info, just in case there is a mistake in it...
--
/etc/sysconfig/network # cat ifcfg-eth1 BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' UNIQUE='VCu0.AujCtKsDPG3' _nm_name='bus-pci-0000:01:00.0'
BOOTPROTO_1='static' BOOTPROTO_2='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24
I am a loooooooong way from being an expert on networks.... in fact I'm much closer to being a novice. I thought that something like 192.168.0.1/24 described a network. Shouldn't you just put in an ip address like. 192.168.0.1? Please, be easy on me if I'm wrong, but I will except bows if right. ;)
LABEL_1=1 LABEL_2=2
Doug
On Friday 10 September 2004 09:20 pm, Doug B wrote:
BOOTPROTO_1='static' BOOTPROTO_2='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24
I am a loooooooong way from being an expert on networks.... in fact I'm much closer to being a novice. I thought that something like 192.168.0.1/24 described a network. Shouldn't you just put in an ip address like. 192.168.0.1? Please, be easy on me if I'm wrong, but I will except bows if right. ;)
LABEL_1=1 LABEL_2=2
Nevermind... I should try things first... or read things first... open mouth (or keyboard second... or last). I used the 192.168.0.1/24 and set up a third virtual interface, not problem. Apparently a short cut for defining ip, broadcast and netmask on a line? The only thing I can see I'm doing different is defining all as static. Doug
On Friday 10 September 2004 05:29 pm, Patriiiiiiiiiick wrote:
I am putting the config file below for info, just in case there is a mistake in it...
/etc/sysconfig/network # cat ifcfg-eth1 BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' UNIQUE='VCu0.AujCtKsDPG3' _nm_name='bus-pci-0000:01:00.0'
BOOTPROTO_1='static' BOOTPROTO_2='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24 LABEL_1=1 LABEL_2=2
I tried using: BOOTPROTO_2='dhcp' LABEL_2=2 Setting up network interfaces: lo lo IP address: 127.0.0.1/8 done eth0 device: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) eth0 IP address: 192.168.1.2/24 eth0:1 IP address: 192.168.0.100/24 done Then I tried: BOOTPROTO='dhcp' LABEL_2=2 Setting up network interfaces: lo lo IP address: 127.0.0.1/8 done eth0 device: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) eth0 (DHCP) . . . . . no IP address yet... backgrounding. waiting Seems it doesn't like the '_2' on BOOTPROTO. I think the reason I got the waiting on dhcp is because this machine is also my dhcp server and the static interface dhcp runs on (even though listed first) wasn't set up yet. ifconfig confirms that eth0 and eth0:1 are up (after backgrounding?) when the restart finishes. Anyway... try: <leave first part as is> BOOTPROTO='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24 LABEL_1=1 LABEL_2=2 Worth a shot. Doug
Doug B wrote:
I tried using:
BOOTPROTO_2='dhcp' LABEL_2=2
Setting up network interfaces: lo lo IP address: 127.0.0.1/8 done eth0 device: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) eth0 IP address: 192.168.1.2/24 eth0:1 IP address: 192.168.0.100/24 done
Then I tried:
BOOTPROTO='dhcp' LABEL_2=2
Setting up network interfaces: lo lo IP address: 127.0.0.1/8 done eth0 device: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) eth0 (DHCP) . . . . . no IP address yet... backgrounding. waiting
Seems it doesn't like the '_2' on BOOTPROTO. I think the reason I got the waiting on dhcp is because this machine is also my dhcp server and the static interface dhcp runs on (even though listed first) wasn't set up yet. ifconfig confirms that eth0 and eth0:1 are up (after backgrounding?) when the restart finishes.
Anyway... try:
<leave first part as is>
BOOTPROTO='static' IPADDR_1=192.168.0.1/24 IPADDR_2=192.168.1.1/24 LABEL_1=1 LABEL_2=2
Worth a shot.
Unfortunately, this doesn't work. I think you had this situation because you set up the static addresses first then you modified your config file and without bringing down the static adresses, you put up the dhcp one. I suppose you can verify this by looking well at your ifconfig results (comparing it to your config). Fortunately, this means the system still supports it but the right way to configure it has to be found. BTW, when reading the top of ifcfg.template, a line says "See 'man 8 ifup' for details." But when you go there, you find: -- WARNING This manpage is not up to date. Please get a newer version of package sysconfig (via YaST Online Update) with a fixed manpage. Only the first part (up to OPTIONS) has so far been rewritten. -- This man page has last been updated in January 2003. It seems they have forgotten to update it. Patrick
participants (5)
-
Daniel Secareanu
-
Doug B
-
Kastus
-
Patriiiiiiiiiick
-
Patriiiiiiiiiick