On 26/10/2023 17:06, Martin wrote:
On Thu, Oct 26, 2023 at 09:54:22AM +0700, Max Nikulin wrote:
#!/usr/sbin/nft -f
table inet sharedconnection {}
flush table inet sharedconnection
# table ip shared connection { ... } from above
I did create FILE.conf and after executing it I can connect to internet from
my phone. THANK YOU!
Now where do I put this FILE.conf? I would like for it to run everytime
I turn on my computer.
I wrote "FILE" in caps trying to express that you can choose any name.
Debian has /etc/nftables.conf and nft supports the "include" directive,
see nft(8). So you may put your file to /etc or to create a dedicated
directory, e.g. /etc/nftables.conf.d, for your settings and include your
file from the main conf file, so it should be applied on each boot by
nftables.service. You may put "table ip shared ..." content directly
into /etc/nftables.conf as well, however I prefer to minimize changes in
files provided by packages when it is possible to use additional ones.
Instead of installing dnsmasq you may specify a public dns server in
your router settings (8.8.8.8, etc.). Or if you are sure that DNS
configuration provided by the upstream router 192.168.0.1 is stable then
you may use servers from DHCP lease. However having a local caching DNS
server (dnsmasq or systemd-resolved) should not harm.
By the way, since you have dnsmasq running, you may enable its DHCP
server (dhcp-range=192.168.231.5,192.168.231.254) and may switch mi
router from static network configuration to DHCP.
As a final note, NetworkManager allows to create "shared" connections
(ipv4.method). It starts dnsmasq and adds necessary firewall nat rules.
I used it in both directions: with ethernet upstream connection to share
wifi or to leverage 1G ethernet link to copy files between laptops while
one of them has an active wifi connection.