How to set my Linux machine to have two network cards with two IPs

How to set my Linux machine to have two network cards with two IPs

Post by keanew.. » Mon, 28 May 2007 18:02:58



Dear all gurus out there,

I am newbie to Linux and networking.

I have a Red hat linux that used as a Database machine, oracle.

I have 2 network cards that I wish to set to 192.168.0.10 and
192.168.0.11 respectively, the default gw is 192.168.0.1. The
connection of the two IPs coming from 2 different switches (still from
the same router).

My purpose is that : if one of the switches is down, my connection
still up with the other side.

I know switch is hardly "down", but i wish to have full redundancy.

What I did is, I jus set the 2 network cards with the two IPs and I
switch off one of the switches, "poof" the whole network
down..........so, how can it be done ?

Or any other alternatives ?

Thanks.

 
 
 

How to set my Linux machine to have two network cards with two IPs

Post by Menno Duursm » Mon, 28 May 2007 20:38:09


[link failover]

Quote:> Or any other alternatives ?

Try the 'bonding' driver:
http://linux-net.osdl.org/index.php/Bonding

And use an interface alias if you still need the second IP adress, e.g.:
ifconfig bond0:1 <ipadress> ...

--
-Menno.

 
 
 

How to set my Linux machine to have two network cards with two IPs

Post by William Pecht » Mon, 28 May 2007 21:45:49




>Dear all gurus out there,

>I am newbie to Linux and networking.

>I have a Red hat linux that used as a Database machine, oracle.

>I have 2 network cards that I wish to set to 192.168.0.10 and
>192.168.0.11 respectively, the default gw is 192.168.0.1. The
>connection of the two IPs coming from 2 different switches (still from
>the same router).

>My purpose is that : if one of the switches is down, my connection
>still up with the other side.

>I know switch is hardly "down", but i wish to have full redundancy.

>What I did is, I jus set the 2 network cards with the two IPs and I
>switch off one of the switches, "poof" the whole network
>down..........so, how can it be done ?

>Or any other alternatives ?

>Thanks.

Google bonding network interfaces...

You need to have one ip address that is on both switches and will move
from a primary to a seconday NIC.

Intel had it's own IANS software on the older Linux versions but is now
supporting standard bonding.  On the 2.4 the Intel stuff was nice but
required at least one Intel NIC per bonded pair.

Bill

--
  "When I think back on all the *I learned in Vax school
  It's a wonder I fixed anything at all."   (to the tune of Kodachrome)
  pechter-at-gmail.com

 
 
 

How to set my Linux machine to have two network cards with two IPs

Post by Tim » Tue, 29 May 2007 03:57:10





>>Dear all gurus out there,

>>I am newbie to Linux and networking.

>>I have a Red hat linux that used as a Database machine, oracle.

>>I have 2 network cards that I wish to set to 192.168.0.10 and
>>192.168.0.11 respectively, the default gw is 192.168.0.1. The
>>connection of the two IPs coming from 2 different switches (still from
>>the same router).

>>My purpose is that : if one of the switches is down, my connection
>>still up with the other side.

>>I know switch is hardly "down", but i wish to have full redundancy.

>>What I did is, I jus set the 2 network cards with the two IPs and I
>>switch off one of the switches, "poof" the whole network
>>down..........so, how can it be done ?

>>Or any other alternatives ?

>>Thanks.

> Google bonding network interfaces...

> You need to have one ip address that is on both switches and will move
> from a primary to a seconday NIC.

Follow on from this:

Caveat: I have only done bonding with 802.3ad for the purposes of link
aggregation (enhanced bandwith), not for failover.

I agree that bonding is probably the neater solution (only ever have one IP)
and I believe that a suitable way would be to use the arp monitoring
failover mode in the linux bonding module. Wanring though: don't just set
up a bonded link in aggregation mode willy nilly or there is going to be
much network weirdness resulting (arp confusion for one). The "ultimate"
documentation can be found in the linux source here:

linux/Documentation/networking/bonding.txt

To the OP - when you have a solution, I would recommend that you test it
thoroughly with 2 tcpdump sessions bound each to one NIC and see if it is
really behaving as you expect. Link aggregation requires support from the
switch infrastructure and I've never come across link aggregation working
where the links feed two different switches. Failover should howvere work
with any kit, though you might get a pregnant pause when the primary link
fails and the switches have to re-discover the path, but that shouldn;t be
more than a few seconds IME.

Cheers

Tim

 
 
 

How to set my Linux machine to have two network cards with two IPs

Post by momo » Tue, 29 May 2007 23:31:46


hi,
this configuration is not a linux issue your configuration is fine
but will not support your target to make a fail over
to make the data base client to use both IP's configure the client
side
tnsnames.ora to fail over the other IP if one faild
the 2nd and the most important is the however your connection
will be established again but you will loose your session
to avoid such issue you should use a caching library in your code
(application) such as oci or jdbc.
one more thing if you really want to make complete redundant use RAC
configuration
as the instance is more critical than the switch
 
 
 

1. Having two separate networks connect using two Linux routers and ISDN

Well could anyone please tell me how to connect two networks using two
Linux routers.

The situation is as follows:

Both are Windows NT domain, with Windows 95/NT workstations.

1st Network ranging IP adresses from 172.16.1.1 to 172.16.1.50
2nd Network ranging IP adresses from 172.16.1.100 to 172.16.1.150
Subnetmask 255.255.255.0

We both have a DIGI Datafire, and two 3c509's available for the Linux
system.
IP adresses are distributed through DHCP and both networks have a DNS
server running (on NT server).

What we want to do now is have two routers connect to each other when we
want to over ISDN.

So when i say (from a windows 95 WS with IP adress 172.16.1.10) "ping
172.16.1.100"
my router should call the other router (or whatever) and relay my
packets to IP adress 172.16.1.100.

I would be very grateful if anyone could help me with this.

Robert

2. mounting dos partition

3. One Process on the machine having two IP address and two ethernet interface.

4. netcpswd

5. two public ips from two networks on one server

6. Tar extract: from Solaris onto AIX - What am I missing?

7. Networking between two PC with both having two Ethernet port

8. Weird focusing behaviour with Cirrus GL-GD5430

9. two network cards, two(?) networks, one computer...

10. How to connect two Linux boxes via Com ports having two wires only

11. Two IPs - one network card - routing not working why???

12. Two Ethernet cards, two networks, now what?

13. Networking between two linux machine without Ethernet Card