LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Share internet from ppp0 (https://www.linuxquestions.org/questions/linux-networking-3/share-internet-from-ppp0-4175478578/)

Scrag 09-25-2013 09:16 PM

Share internet from ppp0
 
Hi.

I have a 3g modem working on my linux box. Its ppp0 when its up and running. Im trying to make my laptop work as a wireless access point when I want. Using Airbase-ng and dhcpd, everything works except I cant figure out how to share the internet (ppp0) with the AP interface (at0). Ive tried:

Code:

iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT

The at0 interface is a 10.0.0.0/24 network and its IP is 10.0.0.1

Id appreciate any help.

Thanks!
Scrag

Ipolit 09-26-2013 06:08 AM

You have to enable ip_forward
echo 1 > /proc/sys/net/ipv4/ip_forward
Flush you filter table temporary to see if you have firewall issue
iptables -F

Scrag 09-26-2013 09:16 AM

Thanks for the response. Here is what im using now in my script, and im afraid clients connect but still no internet. They receive a 10.0.0.0/24 address and a gateway of 10.0.0.1. The DNS servers they get are also 10.0.0.1. Prehaps the problem is I need to configure a dns server or use 8.8.8.8 for dns?

Code:

echo '1' > /proc/sys/net/ipv4/ip_forward
iptables -X
iptables -F
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT

Thanks,
Scrag


All times are GMT -5. The time now is 06:02 PM.