- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- need help on 2 ethernet card different IP on same ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 06:42 PM
тАО03-26-2008 06:42 PM
i would like to seek help regarding my linux server.
i have a linux server with to nic configured with different IP.
eth0 (10.130.16.21) and eth1 (10.130.16.22).
my first question is how can i setup the two nic as depended to each other?
every time i pull the physical cable on eth1 i can still access both IP, and with regards to the routing once i pulled the the physical cable on eth0 both IP are being unaccessible.
is there a problem with my routing table?
here's the routing table:
<
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.130.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.130.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 10.130.16.1 0.0.0.0 UG 0 0 0 eth0
<
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.130.16.0 * 255.255.255.0 U 0 0 0 eth0
10.130.16.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.130.16.1 0.0.0.0 UG 0 0 0 eth0
btw, here my server config and os config:
Server Model: HP ProLiant DL385 G2
Linux Version: Red Hat Enterprise Linux AS release 4 (Nahant Update 6)
thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 12:12 AM
тАО03-27-2008 12:12 AM
SolutionThis is pretty simple.
in /etc/sysconfig/network-scripts
ifcfg-eth0
ifcfg-eth1
Configure them exactly the same except one is eth0 one is eth1 and assign the IP addresses as you wisn.
If this is not working its probably not the OS. A network router could make this difficult, or one of the IP addresses could already be in use elsewhere.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 12:27 AM
тАО03-27-2008 12:27 AM
Re: need help on 2 ethernet card different IP on same subnet
If you feel you must have two NICs is fault-tolerance or extra bandwidth, you should learn about "bonding": two or more NICs can be bonded together to form a single "super-interface". In the simplest fault tolerance modes, all traffic will be automatically switched to the other NIC if the original NIC loses link or can no longer contact a specified MAC address. This is the active/passive, or "fail-over" mode.
For extra bandwidth, there is "active/active" mode, or link aggregation according to IEEE 802.3ad standard. Your network switch must support this and be configured to allow this to be used. There are other load balancing modes which won't necessarily require switch support, but may have other requirements or limitations.
The standard way to add multiple IP addresses in the same subnet for one host is using IP aliases: in some Unixes, that is the only way to do it.
Usually, unless the application specifically bind()s the outgoing socket to a particular source IP address, the system will choose the source address by finding the NIC that is "closest" to the destination according to the routing table. The standard routing table is pre-sorted, and the first matching entry is used. This happens at the IP level, so it has no concept of a "session": each packet is treated as an individual entity.
This is why your system seems to prefer eth0: note that eth0 is listed as the first network in the routing table, and the default gateway is listed only with eth0. In effect, anything going out to the 10.130.16.* segment goes out primarily through eth0, and anything going to other network segments through the gateway will be sent out from eth0 _only_.
Linux _can_ handle multiple NICs in the same subnet, but the required configuration is quite a bit more advanced than "normal".
First, you must set some sysctl settings to non-default values. These are located in /proc/sys/net/ipv4/conf/eth0 and /proc/sys/net/ipv4/conf/eth1, respectively for each NIC.
You must set arp_filter to 1: the default value is 0. You should also review the documentation of arp_announce and arp_ignore settings and set them according to your requirements.
These settings can be changed by commands like "echo 1 > arp_filter", but the changes made in this way are not persistent: when the system is rebooted, the changes are lost. You can use /etc/sysctl.conf file and the "sysctl" command to make the changes persistent across reboots.
The network sysctl settings are documented in Linux kernel documentation. This documentation is available in the kernel-doc package:
if you've registered the system to RedHat Network, execute "up2date --install kernel-doc" to install the documentation, then read "/usr/share/doc/kernel-doc-
The second step would be to implement advanced routing, or "policy routing".
You should read Linux Advanced Routing HOWTO:
http://lartc.org/howto/
(Note: a solid understanding of IP networking fundamentals is essential. Creating a routing policy and applying it requires some careful thinking.)
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 01:02 AM
тАО03-27-2008 01:02 AM
Re: need help on 2 ethernet card different IP on same subnet
two physical NICs with ip-addresses in the same not won't work. If you need two addresses in the same subnet, use ip-aliases. If you need more bandwidth or redundandy, choose bonding. Take a look at the bonding howto:
http://www.cyberciti.biz/howto/question/static/linux-ethernet-bonding-driver-howto.php
Best regards,
Patrick
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2008 12:31 AM
тАО03-28-2008 12:31 AM
Re: need help on 2 ethernet card different IP on same subnet
Another possible slant on this. If you needed to have to Ethernet cards in the same logical subnet, you can split it on your host. Eg.
Main subnet 192.168.1/24 Default gateway 192.168.1.1
Eth0: 192.168.1.63/25
Eth1: 192.168.1.64/25
Using this arrangement only Eth0 can see the default gateway, however you can set up static routes so that Eth1 can route through another host e.g. 192.168.1.65/24.
This is typically how clusters such as HACMP do IP Address Takeover or swapping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2008 07:28 AM
тАО03-28-2008 07:28 AM
Re: need help on 2 ethernet card different IP on same subnet
http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/bonding.txt