Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up wifi hotspot access point
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ups
n00b
n00b


Joined: 06 Sep 2018
Posts: 12

PostPosted: Thu Sep 06, 2018 3:47 pm    Post subject: Setting up wifi hotspot access point Reply with quote

I'm trying to set up hotspot wifi just for home purpose. The scenario is very simple: two laptops, first (A) connected to internet via ppp (mobile modem) and forward net via wifi to laptop B.
I was able to do this by running wpa_supplicant + dhcpd (server) + dhcpcd (client) on machine A and wpa_suppicant + dhcpcd on B. Additionally on A iptables rule had to be activated.

Now, I would like to get rid of dhcpd. I've read that dnsmasq is prefered for such tasks as it is lightweight (whatever that means). Unfortunately it doesn't work for me and frankly speaking I don't understand what exactly this dnsmasq does. Does it replace dhcp server, client or both? And does it set iptables automatically? Here is my current /etc/dnsmasq which doesn't seem to work (doesn't work means that I cannot ssh A --> B or B --> A and internet doesn't work on B):
Code:

#/etc/dnsmasq.conf
# disables dnsmasq reading any other files like /etc/resolv.conf for nameservers
no-resolv
# Interface to bind to
interface=wlp1s0
# Specify starting_range,end_range,lease_time
dhcp-range=10.0.0.3,10.0.0.20,12h
# dns addresses to send to the clients
server=8.8.8.8
server=8.8.4.4


and here is /etc/dhcp/dhcpd.conf which does work:
Code:
subnet 10.0.0.0 netmask 255.255.255.0 {
  range 10.0.0.20 10.0.0.30;
  option domain-name-servers 8.8.8.8;
  option routers 10.0.0.1;
  option broadcast-address 10.0.0.255;
  default-lease-time 600;
  max-lease-time 7200;
}


What do I miss?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Sep 06, 2018 4:52 pm    Post subject: Re: Setting up wifi hotspot access point Reply with quote

ups wrote:
What do I miss?

ups ... the obvious, you don't need dhcp at all. Asign a static IP on both ends, and a route on B to A, and you're done.

You didn't mention how you're configuring the network exactly so I'll leave the specifics.

best ... khay
Back to top
View user's profile Send private message
ups
n00b
n00b


Joined: 06 Sep 2018
Posts: 12

PostPosted: Thu Sep 06, 2018 9:00 pm    Post subject: Re: Setting up wifi hotspot access point Reply with quote

khayyam wrote:
ups wrote:
What do I miss?

ups ... the obvious, you don't need dhcp at all. Asign a static IP on both ends, and a route on B to A, and you're done.

You didn't mention how you're configuring the network exactly so I'll leave the specifics.

best ... khay

I would like to have some kind of automation, otherwise I would need to reconfigure this everytime (sometimes I use other networks on these machines).
I use systemd, so configuration process looks like:
Code:
systemctl start dhcpcd                                         #(there is a hook inside a client which runs wpa_supplicant)
/usr/sbin/dhcpd -f -user dhcp -group dhcp wlp1s0
wpa_gui                                                                         #and choose defined AP by hand
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum