Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Share wifi (internet) over ethernet to other device

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Debian6to11
Posts: 13
Joined: 2021-11-22 10:25

Share wifi (internet) over ethernet to other device

#1 Post by Debian6to11 »

System running Debian 11 with a WiFi card connected to a router.
I want to share that connection with my Ethernet to a switch (LAN).

WiFi card IPv4 is DHCP and my system has a static IP address of 192.168.10.8 assigned from the router.
For my Ethernet card I gave an IP address of 192.168.8.5

In Network Settings in Wired section --> Settings --> IPv4 section, I have a Netmask of 255.255.255.0, what value should I place for Gateway?
In Network Connections --> Ethernet Settings --> IPv4 Settings, I have a Netmask value of 24 which cannot be changed, also what value should I place for Gateway?

In Network Connections --> WiFi Settings --> General tab, I have a priority of 1
In Network Connections --> Ethernet Settings --> General tab, I have a priority of 6

At the moment I can only connect to the internet when the wired connection is off. When I turn it on I completely loose internet, with WiFi showing that is connected and the WiFi icon from taskbar disappearing.

Thanks in advance for your answers. If you know of a good guide let me know.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Share wifi (internet) over ethernet to other device

#2 Post by p.H »

Debian6to11 wrote: 2021-12-05 16:32 I want to share that connection with my Ethernet
Doesn't the network manager has a feature to do this by itself ?
Debian6to11 wrote: 2021-12-05 16:32 WiFi card IPv4 is DHCP and my system has a static IP address
Do you mean "fixed" ? By definition DHCP is dynamic, not static.
Debian6to11 wrote: 2021-12-05 16:32 In Network Settings in Wired section --> Settings --> IPv4 section, I have a Netmask of 255.255.255.0, what value should I place for Gateway?
None. There is no internet access through the ethernet connection.
Debian6to11 wrote: 2021-12-05 16:32 In Network Connections --> Ethernet Settings --> IPv4 Settings, I have a Netmask value of 24
This is a prefix length, not a netmask. The corresponding netmask is the same as above.
Debian6to11 wrote: 2021-12-05 16:32 also what value should I place for Gateway?
None.
By the way, what is the difference between "wired" and "ethernet" settings ?
Debian6to11 wrote: 2021-12-05 16:32 At the moment I can only connect to the internet when the wired connection is off. When I turn it on I completely loose internet, with WiFi showing that is connected and the WiFi icon from taskbar disappearing.
Check "ip addr" and "ip route". Also check if the network manager has a setting which disables wifi when ethernet is enabled or connected.

Debian6to11
Posts: 13
Joined: 2021-11-22 10:25

Re: Share wifi (internet) over ethernet to other device

#3 Post by Debian6to11 »

By the way, what is the difference between "wired" and "ethernet" settings ?
Network Settings has a 'Wired' section for the ethernet.
Network Connections has an 'Ethernet' section for ethernet.
Network Settings and Network Connections are two different windows from which you can configure the network with a GUI.

Since I wrote I assigned a manual address for the WiFi card and it's working okay.
At the moment I can only connect to the internet when the wired connection is off. When I turn it on I completely loose internet, with WiFi showing that is connected and the WiFi icon from taskbar disappearing.
After following your advice and removed the wrong addresses for the gateway and replaced them with none, both networks (internet from WiFi card) and LAN (from Ethernet card) work together without problems.
Doesn't the network manager has a feature to do this by itself ?
Network Settings has 'Use this connection only for resources on its network' option but it does not share internet.
Network Connections has a "Shared to other computers' option but it does not share internet.

On the other side of the switch I have a computer running Windows10 into which I can remote login but I cannot get internet to work on it.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Share wifi (internet) over ethernet to other device

#4 Post by p.H »

On the Debian box, check
- /proc/sys/net/ipv4/ip_forward=1
- masquerading/SNAT is set up on the wireless interface with iptables or nftables if required

On the Windows box, check
- the default router (gateway) IP address matches the Linux box ethernet IP address
- DNS addresses are set up properly (same as the Linux box)

Debian6to11
Posts: 13
Joined: 2021-11-22 10:25

Re: Share wifi (internet) over ethernet to other device

#5 Post by Debian6to11 »

masquerading/SNAT is set up on the wireless interface with iptables or nftables if required
I do not know anything about this, I will look into it.

All the other are checked.

I started running into problems with the WiFi again for some reason. Usually it disconnects after a few minutes of use. Don't understand what is wrong. Before these problems I was able to connect and share internet to the windows box and a NAS connected on the switch. By the time I wrote this I had to disconnect/reconnect the WiFi.

arzgi
Posts: 1183
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Share wifi (internet) over ethernet to other device

#6 Post by arzgi »

Debian6to11 wrote: 2021-12-06 20:51 All the other are checked.

I started running into problems with the WiFi again for some reason. Usually it disconnects after a few minutes of use. Don't understand what is wrong. Before these problems I was able to connect and share internet to the windows box and a NAS connected on the switch. By the time I wrote this I had to disconnect/reconnect the WiFi.
Seems your wifi goes to power save mode, that's has been discussed in many threads.

Debian6to11
Posts: 13
Joined: 2021-11-22 10:25

Re: Share wifi (internet) over ethernet to other device

#7 Post by Debian6to11 »

I do not know if it was that. In the morning everything seemed to be working as it should and I am having no problems (now its late evening).

Post Reply