Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
two NIC´s in the same LAN
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
alexjcg
n00b
n00b


Joined: 16 Aug 2005
Posts: 45

PostPosted: Tue Jul 17, 2007 3:48 pm    Post subject: two NIC´s in the same LAN Reply with quote

Hi all;

I have the following scenario:

I´ve got a gentoo box with two nic´s but I want to use them in the same network. Thats because this machine is my file server, proxy, dhcp and radius. So my problem is that we transfer a lot of files to it per day and it congestion it´s nic so I want to put the two nic´s to work at the same lan but with diferent IP´s and diferen switch ports.
Like for my SMB server IP 192.192.192.60 and for de rest services IP 192.192.192.61 so when someone is tranfering a file (to IP 192.192.19260) there it doesnt uses the nic that is spcified to the other services (192.192.192.61).

How do I do this?


Thanks! :D
Back to top
View user's profile Send private message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Tue Jul 17, 2007 5:12 pm    Post subject: Reply with quote

You have to decide which interface is used to access the default gateway. Here's a config where eth0 is used as default gw:

Code:
config_eth0=( "192.168.1.1/24" )
config_eth0=( "192.168.1.2/24" )

routes_eth0=( "default via 192.168.1.254" )
Back to top
View user's profile Send private message
embobo
Guru
Guru


Joined: 19 May 2003
Posts: 311

PostPosted: Tue Jul 17, 2007 6:08 pm    Post subject: Reply with quote

I'm not sure but I think just doing that will result in all traffic going out the eth0 even if it was received via eth1.

You may want to use bonding (trunking). See, e.g.,

http://www.linuxhorizon.ro/bonding.html
http://linux-ip.net/html/ether-bonding.html
Back to top
View user's profile Send private message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Tue Jul 17, 2007 7:05 pm    Post subject: Reply with quote

Damn. embobo is right. I should start doing only one thing at a time. It was a long hard day :x
Back to top
View user's profile Send private message
alexjcg
n00b
n00b


Joined: 16 Aug 2005
Posts: 45

PostPosted: Tue Jul 17, 2007 8:49 pm    Post subject: Reply with quote

Ok I agree with him :D if I do this I will receive a packege throw eth0 and send it back throw eth1. But bonding isnt like making two nic´s work like one (just raising bandwidth)? I need the two nic´s to work like they ware from diferent machines...

I was thinking here, isnt there a way (by iptables) to force if a package is received from a nic is forced to go out on the same nic?
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4735
Location: Angra do Heroísmo (PT)

PostPosted: Tue Jul 17, 2007 8:57 pm    Post subject: Reply with quote

Hi.
alexjcg wrote:
I was thinking here, isnt there a way (by iptables) to force if a package is received from a nic is forced to go out on the same nic?

Yes, there is. You should take a look at http://www.lartc.org for some examples of advanced network configuration.
_________________
Jorge.

Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
Back to top
View user's profile Send private message
alexjcg
n00b
n00b


Joined: 16 Aug 2005
Posts: 45

PostPosted: Wed Jul 18, 2007 10:20 am    Post subject: Reply with quote

jmbsvicetto wrote:
Hi.
alexjcg wrote:
I was thinking here, isnt there a way (by iptables) to force if a package is received from a nic is forced to go out on the same nic?

Yes, there is. You should take a look at http://www.lartc.org for some examples of advanced network configuration.



I took a lokk there but I didnt find anything similar to my needs. Do you know the "key word" for what I am looking for, ´cause thats makes a lot easyer to find it?
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4735
Location: Angra do Heroísmo (PT)

PostPosted: Mon Jul 23, 2007 10:19 pm    Post subject: Reply with quote

Look at Section 4.2 Routing for multiple uplinks/providers of the lartc document available at http://www.lartc.org/#download.
_________________
Jorge.

Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum