You are not logged in.
I have successfully build a router/firewall with dnsmasq and shorewall following the Archlinux wiki.
I am just wondering what I need to enable it as an wifi access point
I have successfully set up my wifi card in "AP" mode, because I can see the essid from other device.
At the same time, I was replaced
interface=eth0
to
interface=ath0 in /etc/dnsmasq.conf
It should work, right?
But my devices cannot be assigned any IPs.
Why?
Thanks
Offline
Show your dnsmasq.conf (without comments).
1000
Offline
Show your dnsmasq.conf (without comments).
Here is my dnsmasq.conf
interface=eth0
interface=ath0
dhcp-range=10.0.0.3,10.0.0.14,255.255.255.240,1h
Offline
Here is the network related configuration my rc.conf
eth1="eth1 192.168.2.15 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="eth0 10.0.0.2 netmask 255.255.255.240 broadcast 10.0.0.15"
ath0="ath0 10.0.0.1 netmask 255.255.255.240 broadcast 10.0.0.15"
INTERFACES=(eth1 eth0 ath0)
gateway="default gw 192.168.2.1"
ROUTES=(gateway)
BTW, I am running this computer behind my current router now before it can replace it. (the type of small dsl routers you can buy)
Offline
I found and resolved some issues.
1. My wifi card uses madwifi driver, so it was not activated as "Master" mode when boot up.
2. I hacked /etc/rc.d/network and add a couple lines
# don't bring up an interface that's already up
[ "$(/sbin/ifconfig ${1} 2>/dev/null | grep UP)" ] && return 0
# My hacked code in order to set my wifi card (madwifi) in a "master" mode
eval iwopt="\$wlanopt_${1}"
if [ "$iwopt" != "" ]; then
/bin/sleep 10
sh -c "/usr/bin/wlanconfig $1 destroy"
sh -c "/usr/bin/wlanconfig $iwopt"
/bin/sleep 2
fi
# End of my code
eval iwcfg="\$wlan_${1}"
Also, I add one line in /etc/conf.d/wireless
wlanopt_ath0="ath0 create wlandev wifi0 wlanmode ap"
Then, my card is in "master" mode.
3. I experienced new problems:
My device cannot be assigned with an ip, but the dnsmasq log shows it gave out an ip already.
I can fix this problem by turning OFF my other interface eth0.
Offline
Questions:
1. What should I do in order to configure dnsmasq to listen on TWO interfaces ( one wired, one wireless) ?
2. Can I assign different dhcp ip range on these two interfaces? What should I do?
3. If I want the two interfaces to assign ips in the same range, what should I do?
4. Can I then set these two interfaces in the same "zone" if I use shorewall as the router/firewall?
Thanks!
I will write my experience of building this wire/wireless router as a wiki because nothing was mentioned in the Arch Wiki pages yet.
Offline
I'm interested on answers to these questions also
Offline
I'm interested on answers to these questions also
I pretty much figured out these problems by myself after ignored for days.
Questions:
1. What should I do in order to configure dnsmasq to listen on TWO interfaces ( one wired, one wireless) ?
2. Can I assign different dhcp ip range on these two interfaces? What should I do?
You can add something like the following in /etc/dnsmasq.conf:
interface=eth0
dhcp-range=x.x.x.x,......
interface=ath0
dhcp-range=x.x.x.x,.....
dnsmasq will recognize two interfaces and assign two dhcp-range parameters respectively.
3. If I want the two interfaces to assign ips in the same range, what should I do?
Pretty much you cannot do that. You have to give two interface two DIFFERENT SUBNET.
However, my plan was to give 10.0.0.0~127 to eth0 and 10.0.0.128~255 to ath0. I can do that for sure back tweaking netmask to 255.255.255.128.
You can read very nice explanation in Shorewall docs.
4. Can I then set these two interfaces in the same "zone" if I use shorewall as the router/firewall?
Yes, you can do this. By adding something in /etc/shorewall/interfaces like the following:
loc eth0 dhcp,xxx,xxx,xxx,xxx
loc ath0 dhcp,xxx,xxx,xxx,xxx
Have fun!!
Offline
3. If I want the two interfaces to assign ips in the same range, what should I do?
Correct me if I'm wrong, but you could create a bridge (br0) composed of eth0 and ath0. That way you have only one interface and one range, I think.
Last edited by meqif (2008-02-08 10:34:05)
Ricardo Martins ><>< ricardomartins.cc ><>< GPG key: 0x1308F1B4
Offline
Correct me if I'm wrong, but you could create a bridge (br0) composed of eth0 and ath0. That way you have only one interface and one range, I think.
Yes, I think you can do that.
However, it depends on what you want to achieve. For an example, what I want to do is to separate Wifi and LAN apart, and giving different shorewall (iptable) setup.
That's why I did in a way of my previous post.
Offline
I should have quoted the question I was answering. I edited my post to reflect that. Thanks for sharing your findings with us.
Ricardo Martins ><>< ricardomartins.cc ><>< GPG key: 0x1308F1B4
Offline