Jump to content

How i got DNS and DHCP working


Recommended Posts

After many hours of frustration and a couple dozen reflashes i finally got DHCP and DNS working on my FON

When karma is turned on it will show everything including IP.

I have a FON 2100 and am using digininja's firmware located here: Digininja firmware

/etc/config/network

config interface loopback

option ifname lo

option proto static

option ipaddr 127.0.0.1

option netmask 255.0.0.0

config interface wan

option ifname eth0

option proto static

option ipaddr 192.168.0.250 IP to get it connected to the net i have it setup like Darren's for ICS

option netmask 255.255.255.0

option gateway 192.168.0.1

option dns 192.168.0.1

config interface lan

option ifname ath0

option proto static

option ipaddr 10.10.10.1 The starting IP that it gives out when people connect wirelessly

option netmask 255.255.255.0

/etc/config/dhcp

config dnsmasq

option domainneeded 1

option boguspriv 1

option filterwin2k '0' #enable for dial on demand

option localise_queries 1

option local '/lan/'

option domain 'lan'

option expandhosts 1

option nonegcache 0

option authoritative 1

option readethers 1

option leasefile '/tmp/dhcp.leases'

option resolvfile '/tmp/resolv.conf.auto'

config dhcp

option interface lan

option start 100

option limit 150

option leasetime 12h

config dhcp

option interface wan

option start 100

option limit 150

option leasetime 12h

/etc/config/wireless

config wifi-device wifi0

option type atheros

option channel 6

config wifi-iface

option device wifi0

# option network lan

option mode ap

option ssid OpenWifi

option encryption none

/etc/config/firewall

config defaults

option syn_flood 1

option input ACCEPT

option output ACCEPT

option forward REJECT

config zone

option name lan

option input ACCEPT

option output ACCEPT

option forward REJECT

config zone

option name wan

option input REJECT

option output ACCEPT

option forward REJECT

option masq 1

config forwarding

option src lan

option dest wan

option mtu_fix 1

# include a file with users custom iptables rules

config include

option path /etc/firewall.user

/etc/firewall.user

#Allows wireless clients to access the internet

iptables -A INPUT -i ath0 -j ACCEPT

iptables -A INPUT -i eth0 -j ACCEPT

iptables -A OUTPUT -o ath0 -j ACCEPT

iptables -A OUTPUT -o eth0 -j ACCEPT

iptables -A FORWARD -i ath0 -o eth0 -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

#Allow wan to connect via SSH

iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT

iptables -A input_wan -p tcp --dport 22 -j ACCEPT

#Allow wan to open to Webif

iptables -t nat -A prerouting_wan -p tcp --dport 80 -j ACCEPT

iptables -A input_wan -p tcp --dport 80 -j ACCEPT

#Allow wan to open Jasager

iptables -t nat -A prerouting_wan -p tcp --dport 1471 -j ACCEPT

iptables -A input_wan -p tcp --dport 1471 -j ACCEPT

If anyone has suggestions on making my setup better i would greatly appreciate it.

I hope this helps anyone who is having troubles like i did.

Link to comment
Share on other sites

When i first tryed to get Jasager working i was using the kamikaze 8.09 and digininja's madwifi packages would keep crashing when i tryed to turn ath0, so i gave up but when he released his own firmware and everything was working everytime i tryed to set up dhcp and dns to get an IP on Jasager i would get errors. I started doing research on the openwrt forums and got it so i could an IP in Jasager but no internet to the wireless clients. I started more research and found out i need iptables to direct internet to the wireless. The reason i had to reflash so much is that when i try a new setting sometimes i wouldn't be able to get access to my FON after rebooting it and i learned backup config files when they work it cuts out a lot of time.

Link to comment
Share on other sites

  • 2 months later...

I just flashed the new Piranha 2 + Jasager 2.1 image.

then I scp'ed the files you list above ( after doing a copy and paste from the website to a text file )

I made sure to copy everything except the firewall.users file to /etc/config

and the users file to /etc

My Jasager is accepting connections, and issuing ip address, but the clients can not reach the internet.

I have my mac laptop set to ICS my Aircard with my ethernet. ( I changed the ICS network to 192.168.2.1 since

that's what macs use for ICS. )

The clients are able to use DNS, but when I tried to ping www.google.com for example,

the DNS resolves to the IP but it says Dest Port not reachable ( 10.10.10.1 )

say my client is 10.10.10.232, I am able to ping 192.168.2.250 ( the FON Eth0 interface )

and I can ping 192.168.2.1 ( the Laptop Ehthernet Interface )

Also from SSH on the fon, I am able to ping www.google.com.

so it seems to me I have a problem in the Fon, but i'm unable to figure out what it is.

Any thoughts??

is there a typo in the above configs? or is something changes with the new Piranha 2 + Jasager 2.1 ??

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...