Fedora Linux Support Community & Resources Center
  #1  
Old 9th May 2009, 01:46 PM
gtgoku Offline
Registered User
 
Join Date: Aug 2007
Posts: 7
FC9 Create access points with MadWifi

I have the following network interfaces on my Laptop running FC9
Quote:
[root@localhost /]# /sbin/lspci | grep Ethernet
02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 0)
02:02.0 Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)
I have my internet connection on the ethernet card. I need to create a wifi access point using my atheros card and bridge the two, so any device on the wifi will be able to use my internet.

So far I havent even been able to set up an access point using my Atheros card.

I have read through the whole documentation on the MadWifi site with no luck yet.

I installed MadWifi using yum.
Added the following to /etc/modprobe.conf
Quote:
[root@localhost /]# cat /etc/modprobe.conf
## Start Atheros Stuff
alias wifi0 ath_pci
alias ath0 ath_pci
options ath_pci autocreate=sta
## End Atheros Stuff
Then executed the following commands
Quote:
[root@localhost /]# wlanconfig ath0 destroy
Quote:
[root@localhost /]# wlanconfig ath0 create wlandev wifi0 wlanmode sta
ath0
Quote:
[root@localhost /]# /sbin/iwconfig ath0
ath0 IEEE 802.11g ESSID:"" Nickname:""
Mode:Managed Frequency:2.437 GHz Access Point: Not-Associated
Bit Rate:0 kb/s Tx-Power:17 dBm Sensitivity=1/1
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/70 Signal level=-94 dBm Noise level=-94 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Quote:
[root@localhost /]# /sbin/iwconfig ath0 essid "myAP"
Quote:
[root@localhost /]# /sbin/ifconfig ath0
ath0 Link encap:Ethernet HWaddr 06:90:96:6B:3F:E8
inet6 addr: fe80::490:96ff:fe6b:3fe8/64 Scope:Link
UP BROADCAST 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Quote:
[root@localhost /]# /sbin/ifconfig ath0 up
Still the access point was not visible to other devices.

Please tell me what I am doing wrong.
Reply With Quote
  #2  
Old 10th May 2009, 05:20 PM
MaverrickTM Offline
Registered User
 
Join Date: May 2009
Posts: 5
hi,

your Problem is that you configure a client not a Access Point.

Try this:

Quote:
[root@localhost /]# cat /etc/modprobe.conf
## Start Atheros Stuff
alias wifi0 ath_pci
alias ath0 ath_pci
options ath_pci autocreate=ap
## End Atheros Stuff
Quote:
[root@localhost /]# wlanconfig ath0 destroy
Quote:
[root@localhost /]# wlanconfig ath0 create wlandev wifi0 wlanmode ap
After that, add the ESSID and the Channel with iwconfig and start this interface. Thats all


Best Regards from Germany
Mav
Reply With Quote
  #3  
Old 10th May 2009, 09:51 PM
gtgoku Offline
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks Mav,

The problem was NetworkManager, I guess.
I switched off Network manager and then tried creating an access point as you said and now am able to see the network on other devices. Am also able to join the wireless network.

But am unable to share the internet to the other devices on the wireless network.

I tried using brctl to bridge the two interfaces. But if i bridge the interfaces then am able to access internet from the devices connected to the wifi access point, but am unable to use internet from my laptop. I think it is some gateway problem. I use DHCP to configure the ethernet card settings.

Last edited by gtgoku; 10th May 2009 at 10:02 PM.
Reply With Quote
  #4  
Old 11th May 2009, 11:07 AM
MaverrickTM Offline
Registered User
 
Join Date: May 2009
Posts: 5
Hi,

i Have the same setup like you, but im using CentOS.

eth0 = WAN
eth1 = LAN
ath0 = WLAN

But i dont use a Network bridge. Every Interface got a own Subnet, which is routed with IPTables (NAT & ip_forwarding).
I also manage the Subnet with dhcpd for LAN and WLAN.

On my Server, i use the Network manager to manage the ath0 interface. If you want, i can show you my config files.

Im not Ready with this Project but it seems to be work correct. The next steps are the encryption and the new Rules from IPTables than i'm finish with this AP.


Best Regards from Germany

Mav
Reply With Quote
  #5  
Old 11th May 2009, 06:58 PM
gtgoku Offline
Registered User
 
Join Date: Aug 2007
Posts: 7
Hi,

It would be great if I could avoid using a bridge
But I havent used iptables before so I guess I should start going through its man pages.
Also it would be great if you could share your config files.

Currently I use system-network-config to start my eth0 interface, which uses DHCP to get the ip, netmask and gateway. I suppose this will be on subnet.
I then create a wifi access point using the following command
Quote:
wlanconfig ath0 destroy
wlanconfig ath0 create wlandev wifi0 wlanmode ap
iwconfig ath0 essid "MyAP"
iwconfig ath0 channel 03
ifconfig ath0 up
Now Iam able to see the wifi Access Point from other devices. And also able to connect to it.
But if i try pinging the other devices , i get destination host unreachable sometimes and sometimes I get a reply.
So how do I create a subnet for the wifi access point and atleast make the devices accessible to each other.

some ping commands I tried:
Quote:
[elric@localhost ~]$ ping -c 3 -I ath0 169.254.47.139
Warning: cannot bind to specified iface, falling back: Operation not permitted
PING 169.254.47.139 (169.254.47.139) from 193.11.128.16 ath0: 56(84) bytes of data.
64 bytes from 169.254.47.139: icmp_seq=1 ttl=255 time=2.51 ms
64 bytes from 169.254.47.139: icmp_seq=2 ttl=255 time=1.28 ms
64 bytes from 169.254.47.139: icmp_seq=3 ttl=255 time=1.28 ms

--- 169.254.47.139 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.280/1.694/2.518/0.583 ms

[elric@localhost ~]$ ping -c 3 -I ath0 163.11.128.16
Warning: cannot bind to specified iface, falling back: Operation not permitted
PING 163.11.128.16 (163.11.128.16) from 193.11.128.16 ath0: 56(84) bytes of data.
From 193.11.128.16 icmp_seq=1 Destination Host Unreachable
From 193.11.128.16 icmp_seq=2 Destination Host Unreachable
From 193.11.128.16 icmp_seq=3 Destination Host Unreachable

--- 163.11.128.16 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3000ms
pipe 3
169.254.47.139 is an IP of one of the device connected to the wifi AP.

edit:

Ok, 163.11.128.16 was the ip of eth0 :P

anyways I started ath0 with the following command
Quote:
ifconfig ath0 169.245.47.10 netmask 255.255.255.0 up
and now am able to ping the devices on the wifi network

now how do I forward packets between the two interfaces?
Quote:
[root@localhost elric]# cat /proc/sys/net/ipv4/ip_forward
1
ip_forward is enabled so I think I just need to add some rules to iptables right?

Last edited by gtgoku; 11th May 2009 at 09:02 PM.
Reply With Quote
  #6  
Old 11th May 2009, 09:36 PM
MaverrickTM Offline
Registered User
 
Join Date: May 2009
Posts: 5
Hi,

here are my configfiles.

/etc/modprobe.d/madwifi
Quote:
blacklist ath5k

alias wifi0 ath_pci
alias ath0 ath_pci

options ath_pci autocreate=ap
/etc/sysconfig/networking/devices/ifcfg-wifi0
Quote:
# Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)

TYPE=Wireless
DEVICE=wifi0
ONBOOT=no
HWADDR=xx:xx:xx:xx:xx:xx
BOOTPROTO=dhcp
USERCTL=no
/etc/sysconfig/networking/devices/ifcfg-ath0
Quote:
# Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)

TYPE=Wireless
DEVICE=ath0
HWADDR=xx:xx:xx:xx:xx:xx
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.1.0.1
NETMASK=255.255.0.0
BROADCAST=10.1.255.255
NETWORK=10.1.0.0
USERCTL=yes

ESSID="CentOS_AP"
MODE=master
#FREQ=
CHANNEL=9 # [1|2|3|4|5|6|7|8|9|10|11]
RATE=54M # [Auto|1M|2M|5.5M|11M|6M|9M|12M|18M|24M|36M|48M|54M]

IWCONFIG="txpower 63mw nickname gateway"
# domain [off|<value>]
# nwid [Off|<value>]
# sens <value>
# rts [Off|<value>]
# frag [Auto|Off|<value>]
The Parameter "txpower" doesnt work at the first start of this interface. At this moment i dont know Why. Maybe a problem with the old Madwifi Package (0.9.2.1-2).
After a ifdown & ifup this parameter works fine. The Value of 63mw is for the WG311T (Max Value). Maybe you must find your real value of your Card.


ip_forwarding is only to forward packets between all of you connected Interfaces. Now, you can communicate with other Subnet's / Interfaces. You only need IPTables if you want to translate the communication, maybe to connect to a WAN. If you only work in a LAN, you dont need IPTables. IPTables is only for Firewalling and Network address Translation (SNAT).

If you miss a config file, let me know it. I think this are all configs.

Best Regards from Germany

Mav

Last edited by MaverrickTM; 11th May 2009 at 10:20 PM.
Reply With Quote
  #7  
Old 12th May 2009, 01:29 AM
gtgoku Offline
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks Mav,

I tried writing the ifcfg files. And I was able to see two new interfaces in system-config-network.
Also I had to copy ifcfg-ath0 and ifcfg-wifi0 to /etc/sysconfig/network-scripts/
only then ifup and ifdown worked.

Now when I activate ath0 from system-config-network, it says the following:
Quote:
Error for wireless request "Set Mode" (8B06) :
SET failed on device ath0 ; Invalid argument.
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device ath0 ; Invalid argument.
But it makes ath0 active after that.

Then when I try to activate wifi0 I get the following error:
Quote:
rev: 01: No such file or directory
rev: 01: No such file or directory

Determining IP information for wifi0... failed.
Dont know what am doing wrong

Edit:

After playing around with txpower and stuff, I was able to get rid of the two errors i was getting while ifup ath0 and am able to see the wifi network on other devices and connect to them, but am unable to use the Internet from them still.

Last edited by gtgoku; 12th May 2009 at 01:44 AM.
Reply With Quote
  #8  
Old 12th May 2009, 10:08 AM
MaverrickTM Offline
Registered User
 
Join Date: May 2009
Posts: 5
Hi,

Quote:
Originally Posted by MaverrickTM View Post
...

The Parameter "txpower" doesnt work at the first start of this interface. At this moment i dont know Why. Maybe a problem with the old Madwifi Package (0.9.2.1-2).
After a ifdown & ifup this parameter works fine. The Value of 63mw is for the WG311T (Max Value). Maybe you must find your real value of your Card.

...

You dont need to start wifi0 manually. It comes up with ath0.


You cant use your internet because you dont have configure iptables (adding SNAT Rules). At this moment your packets goes in the internet with your LAN Ip as source IP. No one in the Internet can find you under this IP.

Try to activate ipforwarding and ping you LAN interface. If this is working you must only configure your IPTables.

This is a little stupid Script thats adds a SNAT Rules to your IPTables. It can't firewalling but with this Script you should be able to connect with the Internet.

bevor you can use this following Script, you must disable the "Security Level" in system-config-securitylevel. This makes that the default IPTables script is deleted and dont used. IMHO the best setting. After that you can build a new set of Rules. But for your little Test the following Script should be enough.

If you dont disable the "Security Level" IPtables got a default set of Rules. This Script cannot work under this set of Rules because the FORWARD Chain. In the FORWARD Chain you must allow forwarding packets but you dont know iptables so it easier for you if you disable this.

ipt_setup.sh
Code:
#!/bin/bash

#
# path to the needed programms
#
IPTABLES="/sbin/iptables";
AWK="/bin/awk";
IFCONFIG="/sbin/ifconfig";


#
# external interface
#
EXT_IF="PUT HERE YOUR EXTERNAL INTERFACE";


#
# Try to find out the ip-address of the external interface.
# please dont edit the following two lines.
#
EXT_IP="`$IFCONFIG $EXT_IF | $AWK \
  /$EXT_IF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`";


#
# activate ip_forwarding
#
echo "1" > /proc/sys/net/ipv4/ip_forward;


#
# adds the snat rules
#
$IPTABLES -t nat -A POSTROUTING -o $EXT_IF -j SNAT --to $EXT_IP;


exit;
With iptables -t nat -nL you can see the SNAT Rules in the Chain.
My Rules from my test gateway looks like following.

Code:
[root@temp-gateway ~]# iptables -t nat -nL
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  0.0.0.0/0            0.0.0.0/0           to:192.168.2.102

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Best Regards,

Mav

Last edited by MaverrickTM; 12th May 2009 at 09:22 PM.
Reply With Quote
  #9  
Old 12th May 2009, 10:49 PM
gtgoku Offline
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks a lot Mav,

I finally got my network running.

I disabled the firewall using system-config-firewall.
Then ran your ipt_setup.sh script.
Manually set the ip,netmask and gateway of all the other devices on the wifi network.
And everything is working fine now.

Thanks again man.
Reply With Quote
  #10  
Old 13th May 2009, 04:36 PM
MaverrickTM Offline
Registered User
 
Join Date: May 2009
Posts: 5
Hi,

nice.



Best Regards

Mav
Reply With Quote
  #11  
Old 6th June 2009, 02:07 AM
nashwath Offline
Registered User
 
Join Date: Jun 2009
Posts: 1
unable to connect to access point

Hi

I am trying to do a similar thing. Trying to set up my laptop to connect to the internet from another computer that behaves like an access point. I am using CentOs in both. I have installed the drivers for atheros wifi hardware and I am also able to configure this as an access point. However, I am unable to connect to this from my Laptop. The access point is listed as security enabled and demands authentication pass phrase. How can I make this a public access point?

Thanks in advance for your reply

regards,
Ashwath
Reply With Quote
  #12  
Old 18th February 2010, 10:45 AM
kewldudekris Offline
Registered User
 
Join Date: Feb 2010
Posts: 2
linuxsafari
Same here... i'm unable to access my access point

Guys i have the same problem n it still remained unsolved...

I created an access point with the steps mentioned above, but the access point is not visible. I'm trying to connect to this access point via my laptop. Please could help me out to make it visible.

Thanks in advance
Reply With Quote
  #13  
Old 18th February 2010, 11:35 AM
bob's Avatar
bob Online
Administrator (yeah, back again)
 
Join Date: Jul 2004
Location: Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
Age: 72
Posts: 23,296
linuxfedorafirefox
(moved to EOL)
__________________
Linux & Beer - That TOTALLY Computes!
Registered Linux User #362651


Don't use any of my solutions on working computers or near small children.
Reply With Quote
  #14  
Old 18th February 2010, 11:58 AM
kewldudekris Offline
Registered User
 
Join Date: Feb 2010
Posts: 2
linuxfedorafirefox
Thank you Very much friends

Hi guys,
My problem got solved. Guess the problem is wid my firewall...

Bt ya how could i bridge my wireless access point and lan???

Please lemme know if anyone knew the solution fr this ASAP

Thanks in advance
Reply With Quote
  #15  
Old 13th September 2010, 02:59 PM
Aditya Pareek Offline
Registered User
 
Join Date: Sep 2010
Location: India
Age: 30
Posts: 2
windows_vistachrome
Re: FC9 Create access points with MadWifi

Hi Everyone,

I am novice in the field of device drivers and networking....I need your help..

I have the Atheros family wireless card in my desktop with fedora 8 OS...

I want to make it work as a wireless access point .....

Please suggest any URLs showing from the scratch...like installing MadWifi drivers...then making PC as a WAP....

Thanks in advance..

Aditya...!!
Reply With Quote
Reply

Tags
atheros , bridge , fc9 , madwifi , toshiba laptop

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
configuring 8 access points ? hermouche Servers & Networking 0 28th April 2008 10:15 PM
How to access WEP/WPA/WPA2 access points with wpa_supplicant in FC5 Darkmage Guides & Solutions (Not For Questions) 123 10th August 2007 02:47 AM
jumping access points Wangberg Servers & Networking 5 5th May 2007 09:10 PM
FC6 Multiple Wireless Access Points Kippei Hardware & Laptops 1 31st October 2006 06:34 PM
no access to mount points in apache (2.0.54 FC4) markg85 Servers & Networking 1 27th March 2006 09:56 AM


Current GMT-time: 13:54 (Sunday, 22-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat