LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2007, 06:32 PM   #1
nnivanov
LQ Newbie
 
Registered: Nov 2006
Location: Russia, Velikiy Novgorod
Distribution: Slackware 12
Posts: 18

Rep: Reputation: 0
Home Linux router


Hello!

I want to set up home Internet-router with my old home computer. Now I have one notebook and intend to buy (later) another one. I'm not familiar with Linux networking so I need help.

Coming router (Desktop) has Internet-connection through pppoe protocol (I use rp-pppoe's pppoe-start script, but it's no longer important). Yesterday I have bought two new network cards. So, it's now there are three Ethernet interfaces on Desktop:
* eth0 - for pppoe use. It has internal address 10.19.62.31 (netmask 255.255.0.0);
* eth1 - for notebook connection. It has IP-address 10.14.0.1 (netmask 255.255.0.0);
* eth2 - for future use, not configured;

My Notebook has one network card eth0 configured with IP-address 10.19.59.192 (netmask 255.255.0.0);

At first I make sure that ip-forwarding is switched on:

--
# cat /proc/sys/net/ipv4/ip_forward
1
--

The next step was adding routes between Desktop and Notebook:

* On Desktop:
--
# route add 10.19.59.192 eth1
--

* On Notebook:
--
# route add 10.14.0.1 eth 0
--

Ping tests are OK.

But I don't know what should I do later... I know that default route in Notebook must use gateway to access Internet:
--
# route add default gw GATEWAY
--

I supposed that gateway is my Desktop computer:
--
# route add default gw 10.14.0.1
--

But it does't work :-(
Please, help me with this problem.

Thanks in advance.

Nikolay.

P.S. I don't use Windows more than 4 years. Only Linux. I undertake to set up home router mainly to look into Linux networking basics. For purity of my experiment I use Slackware Linux 11.0 in my router (Desktop) (kernel 2.6.17.11 - from kernel.org). Notebook works under SUSE Linux 10 (kernel 2.6.17.11 - from kernel.org).
 
Old 02-13-2007, 06:45 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
What I do is setup eth0 for the wan side. Define IP, Subnet, Gateway or setup as Dynamic DHCP.

Now on the eth1 lan side I setup say 192.168.1.1 IP and subnet 255.255.255.0. You can use other non routable IPs of your choice. But DO NOT define a gateway for this nic. This is what masquerading takes care of for you.

Then I goto here to get a good iptables firewall script generated answering the questions it ask. http://easyfwgen.morizot.net/gen/

Save the script to a file and ' chmod +x name_of_script '. Then as root you can run the command ' ./name_of_script '.

Brian
 
Old 02-17-2007, 06:23 PM   #3
nnivanov
LQ Newbie
 
Registered: Nov 2006
Location: Russia, Velikiy Novgorod
Distribution: Slackware 12
Posts: 18

Original Poster
Rep: Reputation: 0
Brian,

Many thanks for your advices and (especially) for this link:

http://easyfwgen.morizot.net/gen/

Thanks to this link I've figured out, that my router configuration needs with NAT. And now I have right direction to resolve my problem.

Quote:
Originally Posted by Brian1
What I do is setup eth0 for the wan side. Define IP, Subnet, Gateway or setup as Dynamic DHCP.

Now on the eth1 lan side I setup say 192.168.1.1 IP and subnet 255.255.255.0. You can use other non routable IPs of your choice. But DO NOT define a gateway for this nic. This is what masquerading takes care of for you.

Then I goto here to get a good iptables firewall script generated answering the questions it ask. http://easyfwgen.morizot.net/gen/

Save the script to a file and ' chmod +x name_of_script '. Then as root you can run the command ' ./name_of_script '.

Brian
 
Old 02-18-2007, 10:27 AM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Glad to see you are on your way and to be of help.

Brian
 
  


Reply



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
help using debian as a home router xaos5 Debian 12 01-17-2007 07:17 PM
Small linux box as a wireless router/home network ideas enine Linux - Wireless Networking 16 05-09-2006 09:25 PM
want to ssh/ftp to home machine (Slack) from office through home router fincher69 Linux - Networking 2 09-21-2005 10:55 PM
Home Network Setup Help Linux Server running Windoze XP clients + ADSL router BeaverusIV Linux - Networking 10 04-22-2005 04:07 PM
Questions around a home webserver DHCP and using Linux as Router hiplainsdrifter Linux - Networking 23 03-25-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:10 PM.

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
Open Source Consulting | Domain Registration