Setting local network via WiFi

1

There are:

  1. Notebook running Ubuntu 12.04 acting as server machine
  2. LAMP (Linux, Apache, MySQL, PHP) server
  3. Some devices with WiFi ability

I want to configure local WiFi network on my notebook, so that other devices (mobiles, PCs, etc) can access local web applications using their browser. So far I was able to configure such kind of network but I want to apply these options:

  1. Users can connect to local network by typing domain name in the browser instead of IP address of local network.
  2. Users must be able to have access only to port 80, it means they must not be able to access other applications except web applications running on localhost

What settings I should apply?

torayeff

Posted 2013-12-28T04:26:14.503

Reputation: 95

https://www.google.com/search?q=configure+ubuntu+as+a+wifi+hotspot – Collin Grady – 2013-12-28T07:41:15.673

Answers

0

1) Introduce, in your DHCP server config file (located differently on different distros, in Debian and derivatives it is /etc/default/dhcp3-server, for other distros you will have to hunt it don), the following line:

   option domain-name              "your-domain.org";

inside the subnet stanza.

2) use the following iptables rules:

  iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
  iptables -I INPUT 2 -p tcp --dport ! 80 -j DROP
  iptables -I INPUT 3 -p udp -j DROP 

MariusMatutiae

Posted 2013-12-28T04:26:14.503

Reputation: 41 321

0

You could use dnsmasq. It can act as name server and DHCP server with a very simple config. Give it a try.

I'm arguing with the previous solution, because it will block any DHCP-requests or DNS-requests from the clients.

So my suggest is:

iptables -P INPUT DROP #DROP every packet by default

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A -p icmp -j ACCEPT #This line enables ping.

iptables -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT #DNS

iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT #DNS

iptables -A INPUT -p udp -m udp --dport 67 -j ACCEPT #DHCP

iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT #WWW

Hope this helps, Gwyll

Gwyll

Posted 2013-12-28T04:26:14.503

Reputation: 391

I need to access localhost from Android device (still being accessible shared internet), currently I can access it by typing IP address. Now I want to access it by typing name. – torayeff – 2015-02-24T17:46:59.310