[TriLUG] multiple IP from the same network card?

Jason Tower jason at cerient.net
Wed Jun 18 14:00:36 EDT 2003


subnets are a IP (layer 3) thing, a switch operates at layer 2.  the switch 
only cares about the MAC (layer 2) address.  you can have lots of different 
subnets running through a layer 2 switch, but you won't be able to 
communicate between subnets without routing (at layer 3) between them.

jason

On Wednesday 18 June 2003 13:56, lfwelty wrote:
> How do the virtual interfaces work w/ different subnets if you are
> connected via the same physical interface?
>
> ie. Do you have to be plugged into a switch that can handle different
> subnets on the same interface?
>
> Jason Tower wrote:
> > what you are describing is a virtual interface, and it's a snap.  for a
> > quick and dirty setup, you can simply run the following:
> >
> > [root at bigtoe root]# ifconfig eth0:0 10.1.1.1
> >
> > which results in something like the following:
> >
> > [root at bigtoe root]# ifconfig
> > eth0      Link encap:Ethernet  HWaddr 00:A0:C9:5A:DF:F7
> >           inet addr:10.0.0.100  Bcast:10.0.0.255  Mask:255.255.255.0
> >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >           RX packets:454545 errors:0 dropped:0 overruns:0 frame:0
> >           TX packets:311037 errors:0 dropped:0 overruns:0 carrier:0
> >           collisions:0 txqueuelen:100
> >           RX bytes:94017376 (89.6 Mb)  TX bytes:31798276 (30.3 Mb)
> >           Interrupt:10 Base address:0xdc00 Memory:ef201000-ef201038
> >
> > eth0:0    Link encap:Ethernet  HWaddr 00:A0:C9:5A:DF:F7
> >           inet addr:10.1.1.1  Bcast:10.1.1.255  Mask:255.255.255.0
> >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> >           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> >           collisions:0 txqueuelen:100
> >           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> >           Interrupt:10 Base address:0xdc00 Memory:ef201000-ef201038
> >
> > to make this permanent, copy /etc/sysconfig/network-scripts/ifcfg-eth0 to
> > ifcfg-eth0:0 and modify the file contents with the desired info.  you can
> > have several virtual interfaces, all on different subnets.  good luck!
> >
> > jason
> >
> > On Wednesday 18 June 2003 13:29, Michael Winslow Czeiszperger wrote:
> >>Hi--
> >>
> >>I'm working on a new feature for our load testing product and have been
> >>stumped on a Linux configuration issue. The product needs to send out
> >>HTTP requests from multiple IP addresses in order to fake out IP-based
> >>load balancers. To do this I need to configure a Linux box to have
> >>multiple IP addresses on the same network card, but for the life of me
> >>I can't find the HOWTO or docs to do this. Strangely enough it seemed
> >>fairly easy on Windows :-(
> >>
> >>Any pointers to the right documentation would be greatly appreciated...
> >>
> >>Thanks,
> >>
> >>--------------------------------
> >>Michael Czeiszperger
> >>czei at webperformanceinc dot com
> >>Web Performance, Inc.
> >>9207 Baileywick Road, Suite 203
> >>Raleigh, NC 27615
> >>919-845-7601
> >>
> >>_______________________________________________
> >>TriLUG mailing list
> >>    http://www.trilug.org/mailman/listinfo/trilug
> >>TriLUG Organizational FAQ:
> >>    http://www.trilug.org/faq/TriLUG-faq.html
> >
> > _______________________________________________
> > TriLUG mailing list
> >     http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ:
> >     http://www.trilug.org/faq/TriLUG-faq.html




More information about the TriLUG mailing list