[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

outgoing trafi c when you have two ethnet interface

Posted on 2006-05-21
9
Medium Priority
?
287 Views
Last Modified: 2010-03-18

I have two ethernet interface on the RH enterprise linux box which is configure as follow:

Eth0 : 192.168.168.1
Eth1 : 192.168.168.2

On a hardware firewall on the network I have configured that to allow all the trafic incoming/outgoing from eth0
And deny any trafic from eth1. but when I try to ping out I see on the firewall log screen that trafic is coming from eth1.

Now, How do I tell the OS that when I do ping out or try to reach outside world use the eth0 interface.

Thanks,

Raza
0
Comment
Question by:raza
  • 5
  • 3
9 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 16727794
Is Your box acting as bridge? Or both ethX are plugged in same LAN segment?
It's raher strange to have two ethX configured with IPs from same logical LAN(192.168.168.0/255.255.255.0)
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16727806
And please post here:
ip addr
ip route
0
 
LVL 19

Accepted Solution

by:
alextoft earned 200 total points
ID: 16728080
You can specify the interface using the route command. Say your default gateway is 192.168.168.254, use

route add default gw 192.168.168.254 eth0

0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:raza
ID: 16729562

I am not using as bridge.

I do not have access to the machine right now to send you the out put of ip addr and ip route. I will send it later today.

but if both gateway is same and when I run "ping anyserver.com" how it decide that what would be the source ip address.

0
 

Author Comment

by:raza
ID: 16729579

Let say I have this :

Eth0 : 192.168.168.2  GW 192.168.168.254
Eth1 : 192.168.170.2  GW 192.168.170.254

if I "ping  anyserver.com"  what would be the source ip address when it reach to the gw.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16729593
It depends what is set as default gw (output of: ip route) and to what IP address anyserver.com will resolve.
Do You have two default GW set in the system - I don't think so (hence it's possible).
0
 

Author Comment

by:raza
ID: 16729633
thanks for you quick response.


therefore, the source IP address would be the one from whatever eth0 or eth1 is set for defaul route?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16729652
if 192.168.170.254 is the default route and anyserver.com resolves to other than 192.168.168.X then the source IP would be
192.168.170.2
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16731733
> route add default gw 192.168.168.254 eth0
It's not really like Your sollution - try with eth1  You'll see this command fails...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question