LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-31-2011, 04:42 AM   #1
getdev
LQ Newbie
 
Registered: Feb 2011
Distribution: ubuntu + centos
Posts: 15

Rep: Reputation: 0
IP forwarding with ppp0


Hello, after problems on my linksys modem-router (it is KO), I try to connect my private network with my old speed touch home ethernet.

Here problems starts.

I have a server slackware with 3 ethernet cards.

eth0 (192.168.2.2) : connected to hub and is server dhcp for 192.168.2.0/24
eth1 -> pppoe
eth2 (192.168.1.2) : connected to my computer and is also server dhcp for 192.168.1.0/24

My computer get an IPv4 address without problem, but it can't go on internet.

My iptables script is :
Code:
# iptables rules
/usr/sbin/iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
but my PC don't join internet and no log appears in /var/log/syslog nor /var/log/messages on my server.

By searching here I found that link :
http://www.akadia.com/services/pppoe_iptables.html

My pppoe.conf file seems Ok :
...
DEFAULTROUTE=yes
...
CLAMPMSS=1412
...

But when I type :
Code:
# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
90.12.193.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth2
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0
The last route for ppp0 is not set as UG (for gateway) so I del this one and recreate :
Code:
# route del default
# route add default gw 90.12.193.1
# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
90.12.193.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth2
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         90.12.193.1     0.0.0.0         UG        0 0          0 ppp0
But I still can't access to the net with my PC

slacware 13.0
Roaring Penguin PPPoE Version 3.10
iptables v1.4.3.2

Last edited by getdev; 12-31-2011 at 06:06 AM.
 
Old 01-02-2012, 07:36 AM   #2
getdev
LQ Newbie
 
Registered: Feb 2011
Distribution: ubuntu + centos
Posts: 15

Original Poster
Rep: Reputation: 0
I had tried with this lines on my server :
Code:
/usr/sbin/iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/sysctl -w net.ipv4.ip_forward=1
With the last line I now can access internet. But while on my server DNS is OK, it don't work from my PC.

Using traceroute with a google IP :
Code:
# traceroute 173.194.66.147
traceroute to 173.194.66.147 (173.194.66.147), 30 hops max, 60 byte packets
 1  192.168.1.2 (192.168.1.2)  0.450 ms  0.459 ms  0.318 ms
...
11  * * *
12  173.194.66.147 (173.194.66.147)  49.047 ms  50.011 ms  48.229 ms
with DNS :
Code:
# traceroute www.google.fr
www.google.fr: Nom ou service inconnu
Cannot handle "host" cmdline arg `www.google.fr' on position 1 (argc 1)
I'm close to the end I think, but it still not work.
 
Old 01-04-2012, 08:10 AM   #3
getdev
LQ Newbie
 
Registered: Feb 2011
Distribution: ubuntu + centos
Posts: 15

Original Poster
Rep: Reputation: 0
I have added my provider DNS to the DNs configuration for my DHCP and it work.
It's not exactly the way I want, but I'm looking for a new modem-router so I will modify rules after having my new modem.
 
  


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
Port forwarding doesn't work with ppp0 gubak Linux - Server 15 11-13-2009 04:16 AM
Port forwarding on ppp0 interface does not work? tkmbe Linux - Networking 3 04-01-2008 02:10 AM
Endless Loop: ppp0 Unregister Netdevice: waiting for ppp0 to be free. oberon-ken-obi Linux - Networking 1 07-20-2004 11:04 PM
Port Forwarding With Dynamic PPP0 rwyarbrough Linux - Security 2 12-22-2003 08:53 PM
Port Forwarding With Dynamic PPP0 rwyarbrough Linux - Networking 1 12-19-2003 02:44 PM

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

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