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 01-10-2006, 01:56 PM   #1
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474
Blog Entries: 1

Rep: Reputation: 32
IP Forwarding with ppp for a small LAN


I have a small LAN (10 comps). I have a router (192.168.1.1) and i am 192.168.1.80. Now, I have already set up IP forwarding as according to the Gentoo Home router Guide(even though i use slackware). Other comps on the LAN can use me as their localnet router.

BUT, We also have a ppp connection to eticomm.net. I have already set up wvdial(automatic dialer) to connect and i can. I need to be able have all comps on the LAN get out to the internet. I use Static IP for IP address handling.

Does anybody know the correct iptable command to issue and also the correct kernel routing tables? This is an interesting experiment(for fun) but if i can get it working i will start using it as the ppp gateway for the whole LAN.

Thanks in advance

--Samoth
 
Old 01-10-2006, 10:36 PM   #2
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
search about "iptables" and "masquerading" on google, you should find some good example as it is a very common way to share ppp connection. The rule would be like "$IPTABLES -t nat -A POSTROUTING -o ppp+ -s ! 192.168.1.0/255.255.255.0 -j MASQUERADE"
Of course you will need to ajust this to fit your setting... You also need to activate ipv4 forwarding and to allow FORWARD with iptables. See google
 
Old 01-11-2006, 07:04 AM   #3
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474

Original Poster
Blog Entries: 1

Rep: Reputation: 32
i have searched this site and google but i fail to find anything. Anyways should be that in the bottom of the tables? I would think that that should go in the bottom but i am seriously confused about iptables syntax(especially after reading the iptables HOWTO :-) ) those 25+ options are flying around in my head. Is the 192.168.1.0 suppose to be my IP?

P.S. assuming this works what would the IP routing tables look like on a client machine?
 
Old 01-11-2006, 07:22 AM   #4
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
Iptables can be a bit scaring in the begginning but you won't use all these options, ever
The 192.168.1.0 should be your subnet ip. I assumed your range was 192.168.1.0/255.255.255.0 ( or 192.168.1.0/24 in CIDR notation) so it should be correct if it's the case. This is basic networking knowledge.

The routing should look like the following
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
6.3.128.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 6.3.128.1 0.0.0.0 UG 0 0 0 ppp0
 
Old 01-11-2006, 07:36 AM   #5
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474

Original Poster
Blog Entries: 1

Rep: Reputation: 32
I ran across this link: http://www.unixgeeks.org/security/ne...sc/ipmasq.html
Very nice but i have a few questions about the top of the script

# Change LAN to the correct network address and network mask for your LAN
# this can be found by using ifconfig from one of the clients
LAN="192.168.0.0/24"

I dont really know what address to use from the output of ifconfig. Anybody know?
 
Old 01-11-2006, 07:46 AM   #6
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
I told you, you have to use the network mask (netmask). This is somehow the "ip range". It's a bit difficult to explain, but let's consider this is your network ip but with a "0" on the numbers that may change (as example, if your computers are on 192.168.1.1, 192.168.1.2, 192.168.1.3, the "number that change" is obliviously the last one), then you write "255" for every number that are static and 0 for the ones that may change ( so in that case you would have 192.168.1.0/255.255.255.0 ).
Just as example, in the case you would be on a "10.0.0.0" network, the netmask would be ( 10.0.0.0/255.0.0.0 ).
This should get you started but it is usually way more complex than that.

However, all this is very basic networking skills, if you don't know netmask yet, you will have hard time managing a 10 computers LAN, you might want to consider to read some documentations on networking at first.
 
Old 01-11-2006, 07:58 AM   #7
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474

Original Poster
Blog Entries: 1

Rep: Reputation: 32
It is a family LAN(i am 13). I am not really admin on the LAN(everybody takes care of their own comp) but i am interested in learning all their is about networking(i figured this would be a good project). Sorry for my previous post i posted before i saw that you posted again. Thanks
 
  


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
ppp <-> LAN catpants Linux - Networking 1 07-15-2005 04:43 PM
IP forwarding not working on ppp-over-ssh vpn tingdahl Linux - Networking 3 08-27-2004 06:31 PM
Internet via LAN and/or PPP BashTin Linux - Networking 0 10-08-2003 04:38 PM
iptables forwarding from ppp connection onto LAN CoolScan3 Linux - Networking 0 08-23-2002 05:40 PM
how to create ppp server in RH 7.2 as small ISP thro serial port pentium5 Linux - General 5 07-06-2002 06:35 AM

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

All times are GMT -5. The time now is 11:32 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