Linux with two NICs

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Linux with two NICs
# 1  
Old 07-10-2013
RedHat Linux with two NICs

Hello All,
I have Linux box with two interface cards.
Every card has it's own IP Address and Gateway, IP addresses are from different subnets.
eth0   GW
eth1   GW

Third PC is located in network and is trying to access (ping) both interfaces, but one of them is not responding to ping.

What is the easiest way to get ping to both interfaces at the same time?

Thank You, Smilie

Best Regards

Last edited by vbe; 07-10-2013 at 11:49 AM.. Reason: code tags...
# 2  
Old 07-10-2013
Linux will not forward IP traffic unless you enable forwarding for IP traffic. The pinging thing will have to know to use that PC as a gateway, too.

How to do so at boot time can vary depending on your distribution, how to do so at runtime is

echo 1 > /proc/sys/net/ipv4/ip_forward

Last edited by Corona688; 07-10-2013 at 12:14 PM..
# 3  
Old 07-11-2013
Thank You Corona688, but ip_forward is enabled.
The distribution is CentOS and it also enabled on boot by changing net.ipv4.ip_forward = 1 option in /etc/sysctl.conf

Best Regards

---------- Post updated 07-11-13 at 04:03 AM ---------- Previous update was 07-10-13 at 03:11 PM ----------

I found a solution using iproute2:
1. Step: Adding two new Routing Tables
echo 101 T1 >> /etc/iproute2/rt_tables
echo 102 T2 >> /etc/iproute2/rt_tables

2. Step: Filling new created Routing Tables
ip route add dev eth0 src table T1
ip route add default via table T1

ip route add dev eth1 src table T2
ip route add default via table T2

3. Step: Adding Rules
ip rule add from table T1
ip rule add from table T2
As I understand this is for traffic coming from eth0 uses T1, while from eth1 uses T2. (I can be wrong)

Thank You All,

Best Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Networking 2 NICs

Hi all, Host - Ubuntu 12.04 desktop 64bit Virtualizer - Oracle VirtualBox 2 NICs Where can I find relevant document to set up 2 NICs, one for inward bound and another for outward bound, separate channel, both connected to the same router Would following document be appropriate for my... (1 Reply)
Discussion started by: satimis
1 Replies

2. Solaris

Redirect to same port two NICs?

Dear members, I have to problems ; First ; I need to setup two NICs for a Solaris 10 server. But I could not do that unless giving different names in /etc/hosts file. like : testsolaris1 testsolaris2 Second ; After solving first problem I have to setup my... (3 Replies)
Discussion started by: shadowfaxxxx
3 Replies

3. UNIX for Dummies Questions & Answers

How to find about NICs installed

Hi; Is there a way to determine for sure how many NIC ports installed on my Linux box? I tried to run "lspci" but not sure about the results, it's not clear. Below are the results when i run both "ifconfig" & "lspci" on my Linux box i hope someone can help me finding the actual numbers of... (1 Reply)
Discussion started by: Katkota
1 Replies

4. IP Networking

Mutiple nics on Freebsd 7.0

I had the pleasure of having a gig nic given to me this week, which also appears on the hardware list of FreeBSD. What I would LIKE to do is: 1). Set my 10/100 nick as the dedicated outside/internet connection with a lan ip of 2). Set the gig nick as the dedicated... (2 Replies)
Discussion started by: droolin
2 Replies

5. Linux

Two NICs one IP address

I'm looking for a way in RHL 5.1 to use two NICs on one host with two physical IP addresses and map them under one virtual IP address, i.e. NIC 1 NIC2 VIP Basically I want either one of the NICs to ARP for the VIP. No load balancing required just HA. (2 Replies)
Discussion started by: wschmied
2 Replies

6. Solaris

How many NICS do I have?

Hi, is there a way in Solaris 8 to determine how many total NIC's say a Sun Sparc box has installed - plumbed or unplumbed - and find out its capable network speeds and MAC address? I know ifconfig -a but that only shows the plumbed and used interfaces. thx cc (2 Replies)
Discussion started by: bigapple100
2 Replies

7. IP Networking

FreeBSD and two NICs

FreeBSD 4.8, Apache 1.3.27 - two NICs, one with a real-world IP plugged into a switch outside the PIX firewall, the other with a private IP plugged into a switch inside the PIX firewall. Apache listens on both IPs. my domain is so in /etc/rc.conf i have something like this (these... (10 Replies)
Discussion started by: ednix
10 Replies

8. AIX

Merge NICs

Hi friends, I installed oracle 10g ( RAC on 2 IBM p5 570 servers running AIX 5.3ML04 and HACMP5.2 (used Raw devices, not used GPFS). Each server has 4 x 1Gbps ethernet cards (NICs), en0 and en1 for boot address, en2 and en3 for oracle interconnect. Now i want to merge 2 NICs (en2 and... (1 Reply)
Discussion started by: bong02
1 Replies

9. IP Networking

3 nics, 2 with same network/mask

I run openbsd with 3 NICs, ep1 is dhcp, interface with internet ip addy dc0 is sis0 is My system somehow lags, and some services do not work properly, i want to run a lot of local network services like samba, named, ftp, http, dhcpd, radiusd. output of... (1 Reply)
Discussion started by: hachik
1 Replies

10. UNIX for Dummies Questions & Answers

Mac addresses of NICs (why are they the same)

I am training to be support on our solaris based network and was wondering why solaris seems to assign the same mac address to all NICs placed in the machine regardless of how many NICs are in there, when i do a ifconfig -a all nics have same MAC. Presumably this is a feature and there is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
Login or Register to Ask a Question

Featured Tech Videos