Skip to contentSkip to conversation

start up script

DISCUSSION Ravi Kumar Munnangi 4 participants 4 messages Mar 6, 2004 – Mar 9, 2004

lore
Share & tools
lore
#0 lore raw

Users,

Iam working in a LAN with a number of systems. A system has X hardware address and another has Y
hardware address.
I want to set the hardware address of the second
system
also to X.
I also want to set the primary IP addresses of both systems to 172.31.19.30.
So when I ping to 172.31.19.30, both the systems should respond.

The topology of LAN we are using is star. All
systems
are connected to a Switch.
Does the settings change when we are using a bus topology?

Do I have to write a start up script?
How should I write?

My actual goal is to start 2 web servers on two systems with same hardware address and same primary IP address but with different secondary IP addresses. So when a request comes from a client, the request has to be seen by both systems. I will write some mechanism by which only one will respond finally.

Please help!

Thanks in advance,
ravikumar

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw

Hi,

Quoted 13 lines · On Sat, 6 Mar 2004 02:43:03 -0800 (PST) Ravi Kumar Munnangi…

Users,

Iam working in a LAN with a number of systems. A system has X hardware address and another has Y
hardware address.
I want to set the hardware address of the second
system
also to X.
I also want to set the primary IP addresses of both systems to 172.31.19.30.
So when I ping to 172.31.19.30, both the systems should respond.

Quoted 5 lines

The topology of LAN we are using is star. All
systems
are connected to a Switch.
Does the settings change when we are using a bus topology?

First up I don't think you should be doing this. having two systems with the same hardware address on a LAN is going to break things in 'interesting' ways. ARP requests are not likely to work as you expect and the switch is likely to get very confused if it has the same hardware address answering on two different ports.
But then maybe I am wrong.
For what it is worth, here is an extract from the ifconfig man page:
===================================================================

hw class address
Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes cur- rently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).

====================================================================
So if the hardware supports it, ifconfig can do it.

Quoted 7 lines

My actual goal is to start 2 web servers on two systems with same hardware address and same primary IP address but with different secondary IP addresses. So when a request comes from a client, the request has to be seen by both systems. I will write some mechanism by which only one will respond finally.

To me it sounds like you want some kind of load balancing mechanism. If it is really necessary for both systems to see a packet, then some form of forwarding might be what you need.

Hope this helps.

regards,

John Kelly
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#2 lore raw
In reply to Ravi Kumar Munnangi

As someone else already noted, this idea is not as straightforward as you might think it is. Offhand, I cannot think of a situation in which it is a good solution. But you know your actual problem better than I do, so let me tell you what I can about your questions, and leave it to you to decide.

Quoted 8 lines · Ravi Kumar Munnangi

Users,

Iam working in a LAN with a number of systems. A system has X hardware address and another has Y
hardware address.
I want to set the hardware address of the second
system
also to X.

OK. Whether you can do this or not is a hardware issue ... some NICs support it, but others do not. In any case, read the man page for "ifconfig" (or maybe "ip", if your system does not use ifconfig) to see the Linux part of this.

Quoted 2 lines

I also want to set the primary IP addresses of both systems to 172.31.19.30.

OK. As you probably already know, you do this the same way you would set the machine to ANY IP address. The exact details are a bit distro spcecific, and you don't mention which Linux distro you are using ... you may use "ifconfig" directly, "ip" directly, or "ifup" in conjunction with a config file (usually /etc/network/interfaces).

Quoted 2 lines

So when I ping to 172.31.19.30, both the systems should respond.

Yes, because ping is pretty good at handling multiple addresses, and icmp is "connectionless". Whether more complex and TCP-based protocols like http will also work in this setup is less clear to me ... I'd wonder if anyone has ever tried it (except as an accidental misconfiguration).

Quoted 5 lines

The topology of LAN we are using is star. All
systems
are connected to a Switch.
Does the settings change when we are using a bus topology?

Probably not ... but I am not certain what you mean by "bus" in this context. Are you referring to some sort of ring network (like an old-style thinnet LAN)?

Quoted 2 lines

Do I have to write a start up script?
How should I write?

These are distro-level questions ... and to some extent kernel level. Post a followup with the usual details on your setup ... what distro, what version, what kernel version, what NICs and modules ... and I or someones else might be able to answer this one.

Quoted 7 lines

My actual goal is to start 2 web servers on two
systems with same hardware address and same primary IP address but with different secondary IP addresses. So when a request comes from a client, the request has to be seen by both systems. I will write some mechanism by which only one will respond finally.

Before you spend too much time on this approach, you want to think through the "some mechanism" piece. Hand waving won't do here, and I don't see a sensible way to create a mechanism that will work.

My best *guess* is that you want to do one of two things --

1. Load balance -- in normal operation, have each server handle
roughly half of the traffic.
2. Failover -- in normal operation, have one server handle all of
the traffic, but have the second ready and waiting to "hot swap" in if the first should fail.

Either of these needs can be achieved in other, more conventional ways than what you propose to try. The details depend on the content of the Web site ... how much of it is dynamically generated, and how it is generated, how often its static content changes, how you intend to keep the two machines' versions of the Website in sync, and the like ... and may involve a third host (or even a fourth, if a large, shared database is involved).

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#3 lore raw
In reply to Ravi Kumar Munnangi
Quoted 8 lines · Ravi Kumar Munnangi

Users,

Iam working in a LAN with a number of systems. A system has X hardware address and another has Y
hardware address.
I want to set the hardware address of the second
system
also to X.

ifconfig eth0 hw ether 00:56:BA:A4:81:02

Quoted 4 lines

I also want to set the primary IP addresses of both systems to 172.31.19.30.
So when I ping to 172.31.19.30, both the systems should respond.

ifconfig eth0 172.31.19.30 [[ may want to set netmask/BC]]

Quoted 6 lines

The topology of LAN we are using is star. All
systems
are connected to a Switch.
Does the settings change when we are using a bus topology?

Some switches may get confused by having the same MAC address on two ports... In somes cases, it may only send a packet to one fo the machines (usually the last one to use that MAC address))

Quoted 3 lines

Do I have to write a start up script?
How should I write?

Write a regular shell script and then put it in
the proper place. If you have proper rc2.d
script directories, then you can put it near the
SNNnetwork scripts

For RedHat, that would be /etc/rc.d/rc[2345].d/S10network so you could try S09
Otherwise, put it in the r.local file for those kinds of systems.

Setting the MAC addr needs to be done *BEFORE* you bring the card up. (or you need to bring it down). (under Linux)

For RedHat systems, however, you can use the MACADDR= variable in /etc/sysconfig/network-scripts/ifcfg-eth0 and IPADDR=

The RH scripts do the rest.

For the person who said that some cards don't support this, I would say that that is very rare to nonexistent.. the MAC address needs to be softwar settable for things like prosxy arp and bridgng... In 17 years of playing with ethernet, Idon't rememember *ever* seeing a card that you couldn't set the MAC address on.

Quoted 7 lines

My actual goal is to start 2 web servers on two systems with same hardware address and same primary IP address but with different secondary IP addresses. So when a request comes from a client, the request has to be seen by both systems. I will write some mechanism by which only one will respond finally.

Signature · 9 lines
Stephen Samuel +1(604)876-0426                [email protected]
		   http://www.bcgreen.com/~samuel/
   Powerful committed communication. Transformation touching
     the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs