LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2009, 06:07 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
Doubt on Linux as a Router/Gateway?


I read these lines somewhere -


There are more then 400 Computers in your Office. You are appointed as a System Administrator. But you don't have Router. So, you are going to use your One Linux Server as a Router. How will you enable IP packets forward?

Answer and Explanation:

1. /proc is the virtual filesystem, we use /proc to modify the kernel value at running time. So For Current Session:
Code:
echo "1" >/proc/sys/net/ipv4/ip_forward
2. /etc/sysctl.conf when System Reboot on next time, /etc/rc.d/rc.sysinit scripts reads the file /etc/sysctl.conf.

So if you want to permanently set the IP forwarding enable, You should set:
Code:
net.ipv4.ip_forward=1
Here 0 means disable, 1 means enable


Can anyone help me in understanding why we need router ?

Last edited by your_shadow03; 05-15-2009 at 06:08 AM.
 
Old 05-15-2009, 06:10 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Router will enable to you to let computers in different network talk to each other. And thats why you will need it assuming that with a big network you may have different networks.
 
Old 05-15-2009, 06:25 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
You mean If I have LAN1 192.168.0.0/24 and LAN 2 192.168.1.0/24. One of LAN1 machine 192.168.0.254 is made Router1 and on the other side, 192.168.1.254 is made Router2. Then In all the machine under 192.168.0.0 series I need to make GATEWAY point to 192.168.0.254 and all the machines under 192.168.1.0 series point to 192.168.1.254 and hence they can ping to each other network machines.
Correct?
 
Old 05-15-2009, 06:51 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You do not need two machines for that. Once machine with two lan cards with one card having ip 192.168.0.254/24 and other lan card with ip 192.168.1.254/24 will work for you. Each card will work as gateway for the respective network.
 
Old 05-15-2009, 07:01 AM   #5
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Come on for heavens sake, if you do not know why you need a router, should you be managing a network. No wonder hackers can pick and choose large armies of zombies to attack people on the internet.
 
Old 05-15-2009, 07:07 AM   #6
lifeslacker
LQ Newbie
 
Registered: Jan 2008
Posts: 2

Rep: Reputation: 0
400 > 254

In the first place. Most people have their LAN set up with the ubiquitous subnet mask of 255.255.255.0 which gives them a total of 254 hosts. So. You're going to need more than one of those 'standard' LANs to acomodate your 400 machines. For those 2 LANs to talk to each other you will need a router (or gateway as some call it) to pass traffic between the 2.

You are also presumably going to want to have your computers connect to the internet. For that you are definitely going to need a router since you need some way to connect the hosts to the internet line (T1, ADSL or whatever).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 03:17 AM
Using linux as a gateway or router mikescony Linux - Newbie 5 08-30-2007 04:06 AM
Want To use linux as a router/gateway StephenC_IRL Linux - Hardware 2 06-06-2007 03:11 PM
linux as router/gateway/firewall to dsl-router sjoerdvvu Linux - Networking 2 02-24-2006 11:56 PM
gateway for a linux router?? jmono Linux - Networking 12 11-17-2003 10:33 PM


All times are GMT -5. The time now is 03:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration