Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Even not under a real server like scenario, I'm testing with dhcpd for learning and practice purposes. I'm using Ubuntu 12.04 LTS.

I want to offer a network by my eth0 interface. I receive ip and so internet by wlan0.

These are the ip adresses:

192.168.0.1 is my home router.
192.168.19.9 is my wlan0 ip. (Assigned by MAC adress)
192.168.0.196 is my eth0 ip. (Assigned by MAC adress case I plug in to the router)
So, as it might be assumed, my home router dhcp mask is 255.255.0.0.

I want to test it at first with my raspberry. So over my eth0 bears a new network, and it or they (case I plug a switch) get ip adresses from my dhcp server.

This is what I've set for /etc/network/interface file:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
       address 192.168.0.196
       netmask 255.255.255.0
       gateway 192.168.0.196

This is what I've set for /etc/dhcp/dhcpd.conf file:

option domain-name-servers 8.8.8.8,8.8.4.4;

subnet  192.168.0.0 netmask 255.255.255.0{
   option routers 192.168.0.196;
   range  192.168.0.10  192.168.0.120;
}

And I looked for a way to make my clients get access to internet, found this:

sudo iptables -A FORWARD -o wlan0 -i eth0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

However, I'm losing my wlan0 connection and not even my clients get ip not even way out to internet.

I simply want to receive and consume connection by wlan0, generate a new network over eth0 and share my wlan0 internet through it. What's wrong in my configuration?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.