[opensuse] virtual network interface?
Hi, SuSE 9.0 accepted files /etc/sysconfig/network/ifcfg-eth0:0 to setup a virtual device eth0:0 with a private IP, while eth0 was the public one. I haven't found a way to do that on SuSE 10.1? If I use the ifcfg-eth0:0 file, eth0:0 is tried to setup during boot, but fails. I tried to configure it with yast, but yast proposes a device "eth-0:0", and when I set this up and call "ifup eth-0:0" afterwards, it says "Interface eth-0:0 is not available". Calling "ifconfig eth0:0 ..." manually works, but I want a config file in /etc/sysconfig/network so that the device is handled automatically. Is this possible? cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Frank Steiner escribió:
Hi,
SuSE 9.0 accepted files /etc/sysconfig/network/ifcfg-eth0:0 to setup a virtual device eth0:0 with a private IP, while eth0 was the public one.
I haven't found a way to do that on SuSE 10.1? If I use the ifcfg-eth0:0 file, eth0:0 is tried to setup during boot, but fails. I tried to configure it with yast, but yast proposes a device "eth-0:0", and when I set this up and call "ifup eth-0:0" afterwards, it says "Interface eth-0:0 is not available".
Calling "ifconfig eth0:0 ..." manually works, but I want a config file in /etc/sysconfig/network so that the device is handled automatically.
Is this possible?
cu, Frank
In opensuse 10.0 it's diferent. The easyest way to do that is within yast. Look at /etc/sysconfig/network. You can find a file called like this (can differ in the last numbers, the MAC address of your NIC): ifcfg-eth-id-00:0c:xx:xx:xx:xx I have a virtual interface. If you check the content of my ifcfg-eth-id-00:0c:xx:xx:xx:xx file you will see something like this: BOOTPROTO='static' BROADCAST='' IPADDR='192.168.0.32' MTU='' NAME='Dell 82562EZ 10/100 Ethernet Controller' NETMASK='255.255.255.0' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' UNIQUE='rAUF.4JaxctxhRiB' USERCONTROL='no' IPADDR_luna='192.168.0.31' NETMASK_luna='255.255.255.0' LABEL_luna='luna' _nm_name='bus-pci-0000:02:08.0' In yast, choose Additional Address (or something like that, i have suse in spanish) to define additional addresses over the same fisical network interface --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
SuSE 9.0 accepted files /etc/sysconfig/network/ifcfg-eth0:0 to setup a virtual device eth0:0 with a private IP, while eth0 was the public one.
In opensuse 10.0 it's diferent.
BOOTPROTO='static' BROADCAST='' IPADDR='192.168.0.32' MTU='' NAME='Dell 82562EZ 10/100 Ethernet Controller' NETMASK='255.255.255.0' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' UNIQUE='rAUF.4JaxctxhRiB' USERCONTROL='no' IPADDR_luna='192.168.0.31' NETMASK_luna='255.255.255.0' LABEL_luna='luna' _nm_name='bus-pci-0000:02:08.0'
Simple: IPADDR='192.168.222.1' IPADDR_2='10.10.10.10' NETWORK='192.168.222.0' NETWORK_2='10.0.0.0' NETMASK='255.255.255.0' NETMASK_2='255.0.0.0' etc. -`J' -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jan Engelhardt wrote
IPADDR='192.168.222.1' IPADDR_2='10.10.10.10'
NETWORK='192.168.222.0' NETWORK_2='10.0.0.0'
NETMASK='255.255.255.0' NETMASK_2='255.0.0.0'
Ok, that's really simple and a much better concept than in 9.0 :-) Thanks! cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Frank Steiner wrote
Jan Engelhardt wrote
IPADDR='192.168.222.1' IPADDR_2='10.10.10.10'
NETWORK='192.168.222.0' NETWORK_2='10.0.0.0'
NETMASK='255.255.255.0' NETMASK_2='255.0.0.0'
Ok, that's really simple and a much better concept than in 9.0 :-)
Hmm, but it isn't really the same. While the host can be pinged with the IPADDR_2, I can't see it in ifconfig. And I guess I can't (or at least, don't know how to) setup a separate routing for private addresses, like I could do when the private address was an own virtual device eth0:0? cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2006-10-05 at 15:05 +0200, Frank Steiner wrote:
Frank Steiner wrote
Jan Engelhardt wrote
IPADDR='192.168.222.1' IPADDR_2='10.10.10.10'
NETWORK='192.168.222.0' NETWORK_2='10.0.0.0'
NETMASK='255.255.255.0' NETMASK_2='255.0.0.0'
Ok, that's really simple and a much better concept than in 9.0 :-)
Hmm, but it isn't really the same. While the host can be pinged with the IPADDR_2, I can't see it in ifconfig. And I guess I can't (or at least, don't know how to) setup a separate routing for private addresses, like I could do when the private address was an own virtual device eth0:0?
The above example will work _if_ you keep the numbers in the same subnet. To use different subnets on the same PC use different physical devices or you will have nothing but problems with routing. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Kenneth Schneider wrote:
The above example will work _if_ you keep the numbers in the same subnet. To use different subnets on the same PC use different physical devices or you will have nothing but problems with routing.
I never had problems with multiple disjoint subnets on one interface, but that may be due to using ip instead of ifconfig. ifconfig has reached its end of life. ip is much more powerful and easy to use. For example, if you want to add an IP to an interface: # ip address add 172.16.4.3/16 broadcast 172.16.255.255 dev eth0 Another IP to the same interface (short notation): # ip a a 192.168.5.7/24 brd + dev eth0 No virtual interfaces needed. Regards, Carl-Daniel -- http://www.hailfinger.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carl-Daniel Hailfinger wrote:
Kenneth Schneider wrote:
The above example will work _if_ you keep the numbers in the same subnet. To use different subnets on the same PC use different physical devices or you will have nothing but problems with routing.
I never had problems with multiple disjoint subnets on one interface, but that may be due to using ip instead of ifconfig. ifconfig has reached its end of life. ip is much more powerful and easy to use.
For example, if you want to add an IP to an interface: # ip address add 172.16.4.3/16 broadcast 172.16.255.255 dev eth0 Another IP to the same interface (short notation): # ip a a 192.168.5.7/24 brd + dev eth0
No virtual interfaces needed.
It's preferable that this be controlled by the suse init scripts rather than ad-hoc commands, for manageability sake. Just go to yast->network devices-> and select the interface of interest. For that interface, go to advanced->additional addresses and enter IPs at will, even disjoint subnets - they are all added with no problem, and they *do* show up in the ifconfig output. As one poster mentioned, look at the /etc/sysconfig/network/ifcfg-eth-xxx-xxx-xxx-xxx file to see the format of the additional IPs - it's fairly straightforward. Joe --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
J Sloan wrote
For example, if you want to add an IP to an interface: # ip address add 172.16.4.3/16 broadcast 172.16.255.255 dev eth0 Another IP to the same interface (short notation): # ip a a 192.168.5.7/24 brd + dev eth0
No virtual interfaces needed.
It's preferable that this be controlled by the suse init scripts rather than ad-hoc commands, for manageability sake.
Just go to yast->network devices-> and select the interface of interest. For that interface, go to advanced->additional addresses and enter IPs at will, even disjoint subnets - they are all added with no problem, and
But that still doesn't solve the problem: Having eth0:0 allows to add a special routing entry for that virtual device, just adding a second IP to eth0 does not. So this doesn't really help.
they *do* show up in the ifconfig output. As one poster mentioned, look
They don't do here: galois home/fst# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:0A:5E:02:9B:39 inet addr:141.84.1.30 Bcast:141.84.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2263 errors:0 dropped:0 overruns:0 frame:0 TX packets:2203 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:418308 (408.5 Kb) TX bytes:357885 (349.4 Kb) Interrupt:169 galois home/fst# ip a 1: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0a:5e:02:9b:39 brd ff:ff:ff:ff:ff:ff inet 141.84.1.30/24 brd 141.84.1.255 scope global eth0 inet 192.168.141.30/24 brd 192.168.141.255 scope global eth0 There is no problem calling "ifconfig eth0:0 192.168.141.30 up" to set up a virtual device. I just wonder why it is not possible to define a virtual device via an ifcfg-file so that /etc/init.d/network will set such a device up. cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
But that still doesn't solve the problem: Having eth0:0 allows to add a special routing entry for that virtual device, just adding a second IP to eth0 does not. So this doesn't really help.
they *do* show up in the ifconfig output. As one poster mentioned, look
They don't do here:
galois home/fst# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:0A:5E:02:9B:39 inet addr:141.84.1.30 Bcast:141.84.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2263 errors:0 dropped:0 overruns:0 frame:0 TX packets:2203 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:418308 (408.5 Kb) TX bytes:357885 (349.4 Kb) Interrupt:169
galois home/fst# ip a 1: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0a:5e:02:9b:39 brd ff:ff:ff:ff:ff:ff inet 141.84.1.30/24 brd 141.84.1.255 scope global eth0 inet 192.168.141.30/24 brd 192.168.141.255 scope global eth0
There is no problem calling "ifconfig eth0:0 192.168.141.30 up" to set up a virtual device. I just wonder why it is not possible to define a virtual device via an ifcfg-file so that /etc/init.d/network will set such a device up.
Hm? Is not the IPADDR / IPADDR_2 thing enough? -`J' -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jan Engelhardt wrote
There is no problem calling "ifconfig eth0:0 192.168.141.30 up" to set up a virtual device. I just wonder why it is not possible to define a virtual device via an ifcfg-file so that /etc/init.d/network will set such a device up.
Hm? Is not the IPADDR / IPADDR_2 thing enough?
Yes it is. I just made a mistake thinking about routing entries. But of course I can set an additional routing entry for eth0 as well as for eth0:0. So, yes, it's enough, ignore my last mail :-) cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Frank Steiner wrote:
They don't do here:
galois home/fst# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:0A:5E:02:9B:39 inet addr:141.84.1.30 Bcast:141.84.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2263 errors:0 dropped:0 overruns:0 frame:0 TX packets:2203 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:418308 (408.5 Kb) TX bytes:357885 (349.4 Kb) Interrupt:169
You issued a command that says "show me eth0 only", and it did as you asked. Instead, you should have typed just "ifconfig". Joe --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 09 October 2006 4:16 am, Frank Steiner wrote:
But that still doesn't solve the problem: Having eth0:0 allows to add a special routing entry for that virtual device, just adding a second IP to eth0 does not. So this doesn't really help.
It's the same physical interface. What ifconfig creates here are not really "virtual devices", like vlans. The :n entries were a hack to work around the old ifconfig interface limitations. The new iproute2 interface is far superior and way more flexible. If you want to add custom routes, see 'man routes' and edit /etc/sysconfig/network/routes, if your device is persistent, or /etc/sysconfig/network/ifroute-<same-id-as-interface> if your device is not persistent. How about an example? Say I have two networks on my physical lan (I actually do at work and at home) 10.1.2.0/24 and 192.168.1.0/24. The IP addresses for the networks are 10.1.2.2 and 192.168.1.2, respectively. I want my default route to be 10.1.2.1, but I want traffic to www.opensuse.org (130.57.4.24) to go through 192.168.1.1. /etc/sysconfig/network/ifcfg-eth-id-00:00:00:00:00:00: BOOTPROTO='static' NAME='My special interface' STARTMODE='auto' USERCONTROL='yes' IPADDR='10.1.2.2/24' IPADDR_OTHER='192.168.1.2/24' /etc/sysconfig/network/routes: 130.57.4.24 192.168.1.1 255.255.255.255 - default 10.1.2.1 - - If the device is transient, you can put your special route in a device-specific file that has the same format as routes. /etc/sysconfig/network/ifcfg-eth-id-00:00:00:00:00:00: 130.57.4.24 192.168.1.1 255.255.255.255 - You can look at your routing table by executing 'ip route'. When the kernel needs to route a packet somewhere, it goes through this table in order until it finds a matching route. For the network I described above, it should look like this: 130.57.4.24/32 via 192.168.1.1 dev eth0 10.1.2.0/24 dev eth0 proto kernel scope link src 10.1.2.2 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2 default via 10.1.2.1 dev eth0 Hope that helps, -- James Oakley jfunk@funktronics.ca --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
NETMASK_2='255.0.0.0'
Ok, that's really simple and a much better concept than in 9.0 :-)
Hmm, but it isn't really the same. While the host can be pinged with the IPADDR_2, I can't see it in ifconfig. And I guess I can't (or at least, don't know how to) setup a separate routing for private addresses, like I could do when the private address was an own virtual device eth0:0?
For Gods sake, please stop using outdated ifconfig on Linux, and use `ip a` instead. (might need /sbin/ip if /sbin is not in $PATH) -`J' -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
Carl-Daniel Hailfinger
-
Frank Steiner
-
J Sloan
-
James Oakley
-
Jan Engelhardt
-
Kenneth Schneider
-
Luis O.