Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 nic gateway issues?!
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
smurfd
Apprentice
Apprentice


Joined: 04 May 2005
Posts: 176

PostPosted: Tue Jun 24, 2008 12:41 pm    Post subject: 2 nic gateway issues?! Reply with quote

Hey!

So im having abit of a blackout here. Have had this done a few years back, but um due to hardware failure and such now i need to set it up again.
And i dont have saved my confs and such.

So the scenario is like this : {Internet} - [Gateway] - [Workstation]

i have two nics in my gateway. eth0 and eth1.
eth0 gets its ip from dhcp.
eth1 is lets say 192.168.1.1

and my workstation has 1 nic, eth0, with lets say 192.168.1.2
so here if i understand things correctly i'd put in my /etc/conf.d/net
config_eth0=( "192.168.1.2 netmask 255.255.255.0" )
routes_eth0=( "default via 192.168.1.1" )
than that shouldnt be any more issues.

But on the gateway/Router?!
it demands some ip-forwarding mojo, right?

tnx for any advice.
Back to top
View user's profile Send private message
salmonix
Guru
Guru


Joined: 16 Jul 2006
Posts: 410

PostPosted: Tue Jun 24, 2008 2:34 pm    Post subject: Reply with quote

It needs IP forwarding AND ip masquarade too to reach the net.
Forwarding would "connect" the 2 NICs of your router passing traffic between them (you can set it in /etc/sysctl.config permanently). Masquarading (iptables) would carefully translate the address of the real source - the client NIC - to the server external NIC there and back. So, both is needed.

See Gentoo Wiki: Advanced routing (or so)
_________________
Quis custodiet ipsos, custodes?
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