[Webinar] Streamline your web hosting managementRegister Today

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

Router under Linux

What is all need steps to configure Red Hat 6.0 to work as
one router for connect one LAN to ISP via dial-up connections.
IP address is dynamic.
  • 3
1 Solution
The only way and the most easy to do that is to do an ip masquerading.
The LAN computer can access internet (ftp, www, etc..) but cannot be accessed from the internet.

I cannot write here 5 howtos to answer you. But i can give you the links needed :

To learn about your modem installation :

To learn about isp access :

To learn about ip-masquerade :

and if needed, to learn about firewalls :
if you want to see the list of all HOWTO's, take a look at :
globalvAuthor Commented:
This is not answer on my question.  I know
for how-to documentation. But documentation
is not clear for understanding. My question is
only for router configuring, not for modems,
network cards and etc...  My ppp connection work,
and LAN work, but I can't configure router for
this machine.
Connection to my LAN must by in and out,
dependent of requirements of these systems.
If you have a LAN wiht IPs like 192.168.X.X or other private network addres and if you have an ip-masquerade "router" (it's the only way to provide internet addres to a local network with that kind of address) you'll never have a "in" connection possible. I mean that, for example, no one of your LAN "internal" computers can start a ftp server that can be accessed from internet : it is simply not possible ! But, of course, all the computers inside can access the internet without any problem !

If you can obtain a valid ip for each one of your LAN internal computers, so it will be possible and the ip-masquerade will not be needed.

Those howto's are very clear and easy to understand, so if you want to do an ip-masquerade router, configure it like described in :

if you have a way to obtain valid ips for each one of your local computers (not recommended and i think it is not your case because you're using a DHCP connection to internet) the only thing that you have to do is to compile the kernel with the ip-routing options.

Every thing that i know about linux i've learned it reading howto's !
heres a very straight forward solution.

type linuxconf

go to Config/Networking/Client Tasks/ Routing and Gateways/Defaults.  

Now check the enable routing.  and accept the changes.  almost done now

in your /etc/rc.d/rc.local file add the following lines exactly how you see them.

/sbin/ipchains -P forward DENY
/sbin/ipchains  -A forward -s -j MASQ

The is my internal network. for example the Linux router will have a real IP from the ISP eventhough its dynamic but your internal computers will have Static IPs assigned by you.  the part of the line tells it to foward all packets comming from 10.10.10.*  so if your IP addressing scheme is different you will need to change this.  Also the /24 means the subnetmask is  Just make sure your gateway on your internal computers are set to the internal network card on your router... this should work hope it helped

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

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