FedoraForum.org - Fedora Support Forums and Community
Results 1 to 15 of 15
  1. #1
    Join Date
    Aug 2007
    Posts
    7

    FC9 Create access points with MadWifi

    I have the following network interfaces on my Laptop running FC9
    [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
    [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
    [root@localhost /]# wlanconfig ath0 destroy
    [root@localhost /]# wlanconfig ath0 create wlandev wifi0 wlanmode sta
    ath0
    [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
    [root@localhost /]# /sbin/iwconfig ath0 essid "myAP"
    [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)
    [root@localhost /]# /sbin/ifconfig ath0 up
    Still the access point was not visible to other devices.

    Please tell me what I am doing wrong.

  2. #2
    Join Date
    May 2009
    Posts
    5
    hi,

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

    Try this:

    [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
    [root@localhost /]# wlanconfig ath0 destroy
    [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

  3. #3
    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.

  4. #4
    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

  5. #5
    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
    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:
    [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
    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?
    [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.

  6. #6
    Join Date
    May 2009
    Posts
    5
    Hi,

    here are my configfiles.

    /etc/modprobe.d/madwifi
    blacklist ath5k

    alias wifi0 ath_pci
    alias ath0 ath_pci

    options ath_pci autocreate=ap
    /etc/sysconfig/networking/devices/ifcfg-wifi0
    # 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
    # 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.

  7. #7
    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:
    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:
    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.

  8. #8
    Join Date
    May 2009
    Posts
    5
    Hi,

    Quote Originally Posted by MaverrickTM
    ...

    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.

  9. #9
    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.

  10. #10
    Join Date
    May 2009
    Posts
    5
    Hi,

    nice.



    Best Regards

    Mav

  11. #11
    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

  12. #12
    Join Date
    Feb 2010
    Posts
    2

    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

  13. #13
    bob's Avatar
    bob is online now Administrator (yeah, back again)
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    72
    Posts
    23,355
    (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.

  14. #14
    Join Date
    Feb 2010
    Posts
    2

    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

  15. #15
    Join Date
    Sep 2010
    Location
    India
    Age
    30
    Posts
    2

    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...!!

Similar Threads

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •