Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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: is my home router. is my wlan0 ip. (Assigned by MAC adress) 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

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

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

option domain-name-servers,;

subnet netmask{
   option routers;

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 -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, when I get networking and network-manager services restarted with that configuration 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


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

Browse other questions tagged or ask your own question.