You are not logged in.

#1 2010-08-08 03:20:57

ubuntu83
Member
Registered: 2010-08-02
Posts: 3

[SOLVED]How do I forward ppp0 traffic to a wifi usb running as a WAP?

I am a new Arch user. I started using Arch just a few days ago. Need your help to forward traffic to the Wireless access point I created on arch. i am using cable internet (ppp0) which I want to share via a usb wifi adapter running as a WAP. I followed the instructions in this link to enable the AP mode. Afterwards I followed the instructions provided in the Arch Wiki to forward the traffic but because of my inexperience I am still unable to connect to the internet. Here is the output of iptables -nvL :

Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   77 31312 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
 3338 1639K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
   16   960 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8 state NEW 
  394 51023 OPEN-UDP   udp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW 
    6   300 OPEN-TCP   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 state NEW 
  394 51023 REJECT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable 
    6   300 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset 
   32   896 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-proto-unreachable 

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 TCPMSS clamp to PMTU 
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
  112  6832 fw-interfaces  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 fw-open    all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-unreachable 

Chain OUTPUT (policy ACCEPT 4010 packets, 595K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OPEN-TCP (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain OPEN-UDP (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain fw-interfaces (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  112  6832 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0           

Chain fw-open (1 references)
 pkts bytes target     prot opt in     out     source               destination 

and iptables -t nat -nvL :

Chain PREROUTING (policy ACCEPT 1436 packets, 113K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 545 packets, 35046 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 552 packets, 35347 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MASQUERADE  all  --  *      ppp0    10.254.239.0/27      0.0.0.0/0           
    0     0 MASQUERADE  all  --  *      eth0    10.254.239.0/27      0.0.0.0/0           
    0     0 MASQUERADE  all  --  *      wlan0   10.254.239.0/27      0.0.0.0/0           

output of ifconfig :

eth0      Link encap:Ethernet  HWaddr 00:25:11:22:07:EF  
          inet6 addr: fe80::225:11ff:fe22:7ef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65439 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4662 errors:0 dropped:0 overruns:0 carrier:2
          collisions:0 txqueuelen:1000 
          RX bytes:6148377 (5.8 Mb)  TX bytes:742809 (725.3 Kb)
          Interrupt:25 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:77 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31312 (30.5 Kb)  TX bytes:31312 (30.5 Kb)

mon.wlan0 Link encap:UNSPEC  HWaddr D8-5D-4C-8C-12-5B-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:180.92.149.249  P-t-P:1.1.1.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:2046 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2173 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:1036816 (1012.5 Kb)  TX bytes:359238 (350.8 Kb)

wlan0     Link encap:Ethernet  HWaddr D8:5D:4C:8C:12:5B  
          inet addr:10.254.239.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::da5d:4cff:fe8c:125b/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:1064 (1.0 Kb)

here is what I am trying to achieve :



                                                                               (user name and pass required for high speed internet ppp0)
                  (ISP)  <------------------------------------------------------------------------------------> My Desktop PC
                                                                  (eth0)                                                 |
                                                                                                                   USB Wifi (WAP)     
                                                                                                                            |
                                                                                                      ----------------------|----------------------------------
                                                                                                      |                                                        |
                                                                                            ( laptop with win 7)                               (laptop with win xp)

Sorry for the mistakes. It's my first post.

Last edited by ubuntu83 (2010-08-09 19:28:22)

Offline

#2 2010-08-08 09:49:01

ubuntu83
Member
Registered: 2010-08-02
Posts: 3

Re: [SOLVED]How do I forward ppp0 traffic to a wifi usb running as a WAP?

bump first post updated with more info.

Offline

#3 2010-08-09 13:46:02

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: [SOLVED]How do I forward ppp0 traffic to a wifi usb running as a WAP?

you need to forward data from your wlan0 interface to the ppp0 interface, so add a rule to fw-interfaces

iptables -A fw-interfaces -i wlan0 -o ppp0 -j ACCEPT

since eth0 is only used for ppp connection, no data is forwarded for eth0, so you should only set an input/output policy for eth0.

in the postrouting rules for the nat table, delete all the rules present and add this rule

iptables -t nat -A POSTROUTING -s 10.254.239.0/27 -o ppp0 -j MASQUERADE

mnake sure that ppp0 is set as your default route and your dns settings are working correctly.

Offline

#4 2010-08-09 17:16:33

ubuntu83
Member
Registered: 2010-08-02
Posts: 3

Re: [SOLVED]How do I forward ppp0 traffic to a wifi usb running as a WAP?

Thanks with your help it's running perfectly.

Offline

Board footer

Powered by FluxBB