Dernière mise à jour : 08/11/2026 à 14h23
Les fichiers de configuration nécessaires au bon fonctionnement du hotspot filaire sont :
- /etc/network/interfaces
Citation :auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
post-up ip a a fe80::42:babe/128 dev eth0
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.0.243.1
netmask 255.255.255.0
iface eth1 inet6 static
address 2a00:5881:8118:1700::42
netmask 64
post-up ip a a fe80::42:babe/128 dev eth1
auto usb0
allow-hotplug usb0
iface usb0 inet dhcp
Je me suis arrangé pour “copier” la configuration wlan0 du hotspot wifi en remplaçant 10.0.242.x par 10.0.243.x
- /etc/dnsmasq.d/dhcpdv6-eth1.conf
Citation :interface=eth1
listen-address=2a00:5881:8118:1700::42
dhcp-range=2a00:5881:8118:1700::,slaac,64,4h
dhcp-option=option6:dns-server, [2001:913::8],[2001:910:800::12]
- /etc/dnsmasq.d/dhcpdv4-eth1.conf
Citation :interface=eth1
listen-address=10.0.243.1
dhcp-range=eth1,10.0.243.10,10.0.243.100,4h
dhcp-option=option:dns-server, 80.67.188.188,80.67.169.12
dhcp-authoritative
bind-interfaces
- /etc/resolv.dnsmasq.conf
Citation :nameserver 89.234.141.66
nameserver 2a00:5881:8100:1000::3
- /etc/dnsmasq.conf
Citation :domain-needed
expand-hosts
listen-address=127.0.0.1
resolv-file=/etc/resolv.dnsmasq.conf
cache-size=256
- /usr/local/bin/wiredgw
Citation :#!/bin/bash
case “${1}” in
start)
# ipv6
ip6tables -w -I FORWARD -i tun0 -o eth1 -j DROP
ip6tables -w -I FORWARD -i tun0 -o eth1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
ip6tables -w -I FORWARD -i eth1 -o tun0 -j ACCEPT
#ip6tables -w -I FORWARD -i eth1 -o wlan0 -j ACCEPT
#ip6tables -w -I FORWARD -i wlan0 -o eth1 -j ACCEPT
ip6tables -w -I INPUT -i eth1 -j ACCEPT
ip6tables -w -I OUTPUT -o eth1 -j ACCEPT
Code BASH :#IPv4 iptables -w -I FORWARD -i tun0 -o eth1 -j DROP iptables -w -I FORWARD -i tun0 -o eth1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -w -I FORWARD -i eth1 -o tun0 -j ACCEPT #iptables -w -I FORWARD -i eth1 -o wlan0 -j ACCEPT #iptables -w -I FORWARD -i wlan0 -o eth1 -j ACCEPT iptables -w -I INPUT -i eth1 -j ACCEPT iptables -w -I OUTPUT -o eth1 -j ACCEPT ;; stop) # ipv6 ip6tables -w -D FORWARD -i tun0 -o eth1 -j DROP ip6tables -w -D FORWARD -i tun0 -o eth1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT ip6tables -w -D FORWARD -i eth1 -o tun0 -j ACCEPT #ip6tables -w -D FORWARD -i eth1 -o wlan0 -j ACCEPT #ip6tables -w -D FORWARD -i wlan0 -o eth1 -j ACCEPT ip6tables -w -D INPUT -i eth1 -j ACCEPT ip6tables -w -D OUTPUT -o eth1 -j ACCEPT # IPv4 iptables -w -D FORWARD -i tun0 -o eth1 -j DROP iptables -w -D FORWARD -i tun0 -o eth1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -w -D FORWARD -i eth1 -o tun0 -j ACCEPT #iptables -w -D FORWARD -i eth1 -o wlan0 -j ACCEPT #iptables -w -D FORWARD -i wlan0 -o eth1 -j ACCEPT iptables -w -D INPUT -i eth1 -j ACCEPT iptables -w -D OUTPUT -o eth1 -j ACCEPT ;; *) echo "Usage: $0 {start|stop}" exit 1 ;;
esac
- /etc/systemd/system/wiredgw.service
Citation :[Unit]
Description=Gateway for wire link
Requires=network.target
After=ynh-vpnclient.service
Wants=ynh-vpnclient.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/wiredgw start
ExecStop=/usr/local/bin/wiredgw stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target