You are not logged in.

#1 2009-11-02 23:34:58

hidefromkgb
Member
Registered: 2009-08-03
Posts: 146

Wi-Fi AdHoc + routing [SOLVED!]

Dear experts,

Sorry for asking a question probably answered here before, but searching returned no matching threads sad

Here is my situation:
I've got two laptops. First runs Win XP. Second is under Arch 2.6.31, it is connected to the Internet via PPPoE, and has Intel 3945 WiFi adapter onboard.
The problem is to get XP connected to the Internet through WiFi.

Currently, they can "see" (i.e., ping) each other, but nothing more. This is how it works:

Arch-laptop is a server. Interface wlan0 has a static IP 192.168.3.1/24, and is set to Ad-Hoc mode. Dnsmasq daemon provides dynamic IPs, one of which (192.168.3.5) is given to XP-laptop when it requests connection.

I understand that such scheme requires routing, but do not know how to make it work.
The method found in official wiki (# iptables -t nat -A POSTROUTING -o <interface> -j MASQUERADE; /etc/rc.d/iptables restart, where <interface> is the interface responsible for Internet, guess that I need ppp0) seems to do nothing — XP-laptop is not able to ping anything except 192.168.3.1 sad
I tried to flush iptables with iptables -F -t nat before adding the rule above, but it made no difference.

As you can see, I am nearly a newbie in networks (but not in Linux in whole, fortunately); any help is appreciated.

Last edited by hidefromkgb (2009-11-03 19:02:26)

Offline

#2 2009-11-03 13:56:55

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Wi-Fi AdHoc + routing [SOLVED!]

Seems to me you're missing forwarding:

iptables -A FORWARD -s 192.168.0.0/24 -i wlan0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

Might help though if you post your entire iptables ruleset, post the output of iptables-save.

Last edited by Gusar (2009-11-03 13:58:45)

Offline

#3 2009-11-03 19:01:51

hidefromkgb
Member
Registered: 2009-08-03
Posts: 146

Re: Wi-Fi AdHoc + routing [SOLVED!]

@Gusar:
Weeeeehhaaa!!! It works now!
Thank you, Gusar!

Offline

Board footer

Powered by FluxBB