Dans /etc/resolv.dnsmasq.conf j’ai remplacé les ip existantes par les 2 serveurs dns
qui étaient donnés dans la config du hotspot wifi.
Mon ordi reçoit bien une lease, mais rien ne ping. journalctl -f -u dnsmasq me renvoie :
juin 21 01:49:15 DOMAIN dnsmasq[2961]: started, version 2.72 cachesize 256
juin 21 01:49:15 DOMAIN dnsmasq[2961]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect
juin 21 01:49:15 DOMAIN dnsmasq-dhcp[2961]: DHCP, IP range 10.0.243.10 -- 10.0.243.200, lease time 4h
juin 21 01:49:15 DOMAIN dnsmasq-dhcp[2961]: DHCP, sockets bound exclusively to interface eth1
juin 21 01:49:15 DOMAIN dnsmasq[2961]: reading /etc/resolv.dnsmasq.conf
juin 21 01:49:15 DOMAIN dnsmasq[2961]: using nameserver adresse_dns1#53
juin 21 01:49:15 DOMAIN dnsmasq[2961]: using nameserver adresse_dns2#53
juin 21 01:49:15 DOMAIN dnsmasq[2961]: read /etc/hosts - 10 addresses
juin 21 01:49:17 DOMAIN dnsmasq[2962]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
juin 21 01:49:17 DOMAIN systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
juin 21 01:49:50 DOMAIN dnsmasq-dhcp[2961]: DHCPREQUEST(eth1) 10.0.243.198 ******
juin 21 01:49:50 DOMAIN dnsmasq-dhcp[2961]: DHCPACK(eth1) 10.0.243.198 ****** ******
Le DHCP semblant fonctionner correctement, je suppose que ça vient de la configuration du firewall? Avant ces tests j’ai supprimé l’appli hotspot wifi
As-tu essayé de pinguer une adresse IP ou bien un nom de domaine ?
Pour voir si c’est un problème lié à iptables ou bien juste un problème de résolution DNS, sur ton PC essaye de pinguer une adresse IP publique. Par exemple ping 80.67.169.52.
Oui il faut t’assurer qu’il y a une règle iptables qui assure la fonction NAT.
Normalement cette règle iptables est activée automatiquement par l’appli hotspot.
Pour vérifier que le NAT est bien activé tapes ça :
iptables -nvt nat -L POSTROUTING
Tu devrais alors voir quelque chose comme ça :
Chain POSTROUTING (policy ACCEPT 799 packets, 67272 bytes)
pkts bytes target prot opt in out source destination
310 26729 MASQUERADE all -- * tun0 0.0.0.0/0 0.0.0.0/0
J’avais désinstallé le hotspot wifi et iptables -nvt nat -L POSTROUTING ne me renvoyait rien.
Je l’ai ensuite réinstallé, et effectivement j’obtiens ça :
Chain POSTROUTING (policy ACCEPT 385 packets, 23606 bytes)
pkts bytes target prot opt in out source destination
244 19029 MASQUERADE all -- * tun0 0.0.0.0/0 0.0.0.0/0
Le hotspot wifi et le “hotspot filaire” eth1 fonctionnent maintenant correctement. J’ai débranché l’antenne et ça continue à fonctionner (hotspot running)
J’ai aussi fait d’autres modifs sur la configuration ipv6. Je posterai la solution la semaine pro.
Merci beaucoup @pitchum , ça faisait des mois que je voulais réussir à faire ça!
If people are interested, I made a small POC script for this. Though it relies on isc-dhcp-server and not dnsmasq … Mostly because I have no idea what I’m doing
Cool, thanks! I tested it after reinstalling my internet cube from scratch. I ran it connected as root in ssh, but I guess should be run as admin with:
sudo bash deploy.sh
It created a DHCP server on my usb ethernet adapter. All devices connected to this eth1 interface go through my VPN at ARN. It works like a charm but after some testing it looks like it requires the hotspot_ynh wifi app.
Thus I wonder why not just adapting the hotspot_ynh app to provide an optional eth1 configuration.
While doing some test I realized that the POC script only configures IPV4, while vpnclient_ynh is configured mainly on an IPV6 basis with the ARN .cube.
Thus I’m wondering if hotspot_ynh is not providing some configuration that handles the missing IPV4-IPV6 bridging issues.
A question :
My interface is a USB <> ethernet.
When I plug it, the server gives it the name eth1 (all good), but does’nt assign the IP address 10.0.0.1, despite the part of the shell that creates this file : /etc/network/interfaces.d/eth1.conf
If I dont assign manually the IP to eth1 (with ifconfig eth1 up 10.0.0.1), then the command ip a results this :
6: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether a0:ce:c8:5b:59:e9 brd ff:ff:ff:ff:ff:ff
There is indeed no IP adress assigned but the interface is there.
Just to let you know that I found out where the problem was : Raspian uses a weird / different than Debian / poorly documented system to assign a static IP address to an interface.
I uploaded the config files and now everything works as expected.
More information :
To set up a static IP using the new dhcpd system edit your /etc/dhcpcd.conf file and add :