LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-14-2005, 10:55 PM   #1
kwlg
LQ Newbie
 
Registered: Jun 2005
Distribution: Ubuntu,Debian,Mandrake,knoppix,dsl,freesco,SUSE
Posts: 8

Rep: Reputation: 0
eth0+ppp0 routing


Hi all!
Here is my network

linux1:
eth0=192.168.1.1
ppp0=192.168.5.2
gw=192.168.1.2 ( thru ADSL)
compA=192.168.1.6
compB=192.168.1.15


.........................user1,user2
comp A---------|----------------|................................|
......................| linux1----------|------------adsl--------|
comp B---------|----------------|...............................|internet
.............................|......................|--------|
............................. \------ppp0-----|linux2 |---------|
.....................................................|--------|............|

Better network diagram is here:
http://desima.objectis.net/network-diag/


Question: how to allow compB and user2 to use ppp0?

if I change default route to ppp0 then it is posiible to set compA use adsl and compB to use ppp0, if I change default route back to eth0(192.168.1.2) then it is not possible for compB( or user2) use ppp0 for getting acces to internet
got error MASQUERADE: Route sent us somewhere else.

If I route thru other comp on 192.168.1.217 ( which has ppp to internet)
ip route change default via 192.168.1.217 table T2
everithing works!

config:
ip rule ls:
0: from all lookup local
32750: from all fwmark 0x1 lookup T2
32751: from 192.168.5.2 lookup T2
32752: from 192.168.5.1 lookup T2
32756: from 192.168.1.6 lookup T1
32757: from 192.168.1.15 lookup T2
32766: from all lookup main
32767: from all lookup default

ip route table T2
192.168.5.0 dev ppp0 scope link src 192.168.5.2
192.168.1.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.5.1 dev ppp0

ip route ls
192.168.1.0 dev eth0 scope link src 192.168.1.1
192.168.5.1 dev ppp0 proto kernel scope link src 192.168.5.2
203.97.61.42 via 192.168.1.2 dev eth0
192.168.1.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.1.2 dev eth0

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

What I am doing wrong?

Last edited by kwlg; 07-27-2005 at 05:52 PM.
 
Old 07-15-2005, 03:22 AM   #2
kwlg
LQ Newbie
 
Registered: Jun 2005
Distribution: Ubuntu,Debian,Mandrake,knoppix,dsl,freesco,SUSE
Posts: 8

Original Poster
Rep: Reputation: 0
for CompB sorted using
iptables -t nat -A POSTROUTING -j SNAT --to 192.168.5.2 --src 192.168.1.15

or better
iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to-source 192.168.5.2

but stil no luck for user2

Last edited by kwlg; 07-18-2005 at 05:58 PM.
 
Old 07-15-2005, 03:59 AM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Have a look at this, Section 4..
http://tldp.org/HOWTO/Adv-Routing-HOWTO

You need to set some routing tables to match.
Look carefully how replies come back...

Last edited by peter_robb; 07-15-2005 at 04:04 AM.
 
Old 07-15-2005, 01:21 PM   #4
kwlg
LQ Newbie
 
Registered: Jun 2005
Distribution: Ubuntu,Debian,Mandrake,knoppix,dsl,freesco,SUSE
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by peter_robb
Have a look at this, Section 4..
http://tldp.org/HOWTO/Adv-Routing-HOWTO

You need to set some routing tables to match.
Look carefully how replies come back...
Yes it is the first place when I've looked.

When user send a packet it is going thru ppp0 but replies go from linux2 to 192.168.1.1 not thru ppp0. (so they never arrived)

If I change it with SNAT then they come back at ppp0 (192.168.5.2) but not reaching the user
 
Old 07-18-2005, 07:47 AM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Can you make a clearer diagram pls..

I can't see what is connected to where..
 
Old 07-18-2005, 05:50 PM   #6
kwlg
LQ Newbie
 
Registered: Jun 2005
Distribution: Ubuntu,Debian,Mandrake,knoppix,dsl,freesco,SUSE
Posts: 8

Original Poster
Rep: Reputation: 0
network diagram

Better network diagram is here:

http://desima.objectis.net/network-diag/
 
  


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
eth0 / eth1 and ppp0 ikarus Mandriva 8 11-26-2005 08:49 PM
routing ppp0 & ppp1 hariiyer Linux - Networking 1 09-09-2005 05:48 AM
Masquerading ppp0 and eth0 zulfilee Linux - Networking 2 07-20-2004 12:32 AM
ppp0 uses eth0... but eth0 never activates joshuapurcell Linux - Networking 3 12-17-2003 12:52 AM
eth0 and ppp0 fight motyl Linux - Networking 3 05-23-2003 04:16 PM

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

All times are GMT -5. The time now is 10:51 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
Open Source Consulting | Domain Registration