LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-25-2008, 06:53 AM   #1
satish
Member
 
Registered: Jan 2006
Posts: 172

Rep: Reputation: 15
multiple nics


we have 4 nics in our redhat 9 proxy server.

eth0: 192.168.1.2 local ip
eth1: 59.144.124.58 internet static ip
eth2: 192.168.100.149 local ip
eth3: 10.32.138.40 local ip

in office we have our trading software which works on 10.32.138.1 as a gateway,if i didn't specify 10.32.138.1 as a gateway in the trading pc the trading software will not work, i want to do that when i give 10.32.138.40 as a gateway in trading pc it will to work.

Things i want to do without disturbing the internet which works on eth0 (localip) and eth1(static ip).

i want to do that when i specify 10.32.138.1 as a gatway in eth3 the nic will be work as a router but without disturbing the internet,because when i specify 10.32.138.1 as a gatway the internet get down and i cannot ping 192.168.1.2,when i delete the gateway from route command the internet works and i get ping response from 192.168.1.2

Regards


satish
 
Old 06-25-2008, 01:47 PM   #2
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi,

i'm not too sure about your point, but maybe you can use 2 gateways with different metric :
10.32.138.1 metric 1
10.32.138.40 metric 10

or maybe - you can give us more drawing?

like this?

eth1 ------------- eth0, 2, 3?

eth3 goes to 10.32.138.1 machine?

HTH.
 
Old 06-28-2008, 05:54 AM   #3
satish
Member
 
Registered: Jan 2006
Posts: 172

Original Poster
Rep: Reputation: 15
multiple nics

i had tried mettic 1 and metric 10 in client windows xp pc with 2 gatway but only on gatway works.here i am giving you the more clear picture

eth0-eth1 for internet

eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

eth1
DEVICE=eth1
BOOTPROTO=static
BROADCAST=59.144.124.255
IPADDR=59.144.124.58
NETMASK=255.255.255.0
NETWORK=59.144.124.0
ONBOOT=yes

eth1 having gatway 59.144.124.1 for my internet i had defined with route command and i don't want to delete gateway,if i did the internet will not work so i don't want to touch this interface.

eth3
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.32.138.40
NETMASK=255.255.255.0

eth3 i want to define 10.32.138.1 as a gateway,and also i want to route internet to 10.32.138.40 which comes from eth1 and eth0 interface.it just like the matter of multiple nics with multiple gatways forget about eth2 nic.so please help me to sort out this matter
 
Old 06-30-2008, 08:24 AM   #4
dougbourne
LQ Newbie
 
Registered: Jun 2008
Posts: 29

Rep: Reputation: 15
You can define different gateways to all NIC, using ip route.
Search for "plicy based routing" or "advanced routing" or "ip route"
gl
 
Old 06-30-2008, 08:36 AM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
You can't have multiple default routes unless you use ip2 to do policy-based routing. Otherwise there is just one default route that will take precedence. You can have as many static routes as you like, though. So you can say the route to a certain subnet goes to a certain gateway. You can use this to specify how to get to subnets that aren't directly connected.

Are you trying to say that 10.32.138.1 is some other box (firewall or router) that has access to the trading network? You need to get traffic from 10.32.138/24 to there, but you want it to go through the proxy first? Or do you really just want the trading software to go through your proxy and then out to the Internet? I'm not very clear what you're trying to accomplish.

If you're trying to accomplish the latter, you'll need to use source-based routing, unless the trading software is always trying to go to a certain subnet that none of your other traffic goes to. In that case you could just set a static route for that subnet with a gateway of 10.32.138.1.
 
Old 07-02-2008, 04:27 AM   #6
satish
Member
 
Registered: Jan 2006
Posts: 172

Original Poster
Rep: Reputation: 15
multiple nics

eth0 192.168.1.2----- eth1 59.144.124.58 this 2 nics used for internet
eth2 192.168.100.145-------forget about this nic,because my question is about eth3 nic--------10.32.138.40. we have one router in office which is having ipaddress 10.32.138.1,we have to define this router's ip address in every pc as a gateway,if we don't define the router's ip address in the pc my trading software will not work.now i want to say that in eth3 i want to define the route's ip as a gateway it will look like this

eth3
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.32.138.40
NETMASK=255.255.255.0
GATWAY=10.32.138.1

what i want to do from this nic is that i want to configured in each pc 10.32.138.40 as a gatway,i want 2 things from this nic

1 it will route internet packets from eth1,eth0
2 it will route trading software from 10.32.138.1 and my software will work.

it just like a router,please help me to sort it out.

as i am a newbie i don't understand how to configured policy routing

Regards

satish
 
Old 07-02-2008, 04:45 AM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Perhaps it would be best if you think of routing as a decision making process: when I (a NIC) get a packet, which Interface (and hence wire) does my routing table tell me to place the packet.

And for "default route", think of it as "when there is no other match in the routing table, which interface shall the packet be placed on so that it is picked up by a directly connected routing station".

Draw yourself a picture, of your systems and your 4-NIC'd system, and ask those questions at each station, both to and from each interface.
 
Old 07-02-2008, 09:38 AM   #8
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
To do that you'll need to use the ip2 route/rule commands. The lartc documenation is a good read on how to do this, http://www.lartc.org

Essentially you need to add a new table to rt_table and then specify a default route for that table and what ips should use that table for routing, and any other routes you'd like for that table.

so for example if your table was trading

ip route add default via 10.32.138.1 table trading
ip route add 10.32.138.0/24 dev eth3 src 10.32.138.40 table trading
ip rule add from 10.32.138.40 table trading

The still fuzzy part is if you are running the trading app on that box it won't necessarily route out that interface, you'd need to know where it was trying to go and add another ip route/rule or bind the app to that interface. Say it was trying to connect to the trading server at 172.16.0.1, then you'd need something like this:

ip rule add to 172.16.0.1 table trading

And once you are that far you can see that if you know where the trading app is going, you might be able to skip all that and just add a normal route that says route add 172.16.0.1 gw 10.32.138.1 avoiding all the other pain.


I do think however that if you are using that box as a router that you'll want to setup ip2 stuff for each of the interfaces its amazingly powerful stuff and well worth learning.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
10.2 and multiple nics tlarkin SUSE / openSUSE 2 02-01-2007 09:06 AM
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 02:30 PM
Multiple NICS in Solaris 8 triley Solaris / OpenSolaris 8 01-06-2005 11:12 AM
Boot Multiple NICs mariah Linux - Newbie 1 12-31-2003 02:30 PM
multiple NICs paulonline2501 Linux - Hardware 2 07-23-2002 05:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration