• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

setting a gateway

We have a dedicated 64kbps link to internet, we want to use linux as a gateway for our LAN.

 The set up i thought is like this.

  ---------      --------       ---------  
    LAN    |====| LINUX  | ==== | ROUTER |
  ---------      --------       ---------  

 I set up two ethernet cards in linux. I want to send packets coming from lan to router. Linux is not sending packets to second interface, How to transfer data between these two  interfaces.
We are using redhat 5.0
local lan and other is connected to an other
1 Solution
assuming your NIC connected to LAN has IP,
and you NIC connected to ROUTER has IP w.x.y.z1, and
your ROUTER has IP w.x.y.z2, then you need following:

route add -net gw
route add -net w.x.y.0 gw w.x.y.z1
route add -net default gw w.x.y.z2

I don't know if redhat has an appropriate config file (/etc ?),
but you should add these commands anywher in the rc startup
Also make shure that you kernel has enabled IP_FORWARDING
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now