Internet Connection Sharing tutorial

Message
Author
User avatar
m_pav
Developer
Posts: 1390
Joined: Sun Aug 06, 2006 3:02 pm

Internet Connection Sharing tutorial

#1 Post by m_pav »

Having seen a post on the MX Linux Facebook group about ICS WIFI Hotspot where Nicholas Farmer responded with the most appropriate reply, I thought it good to create a screen-cast tutorial & walk-through on how to add ICS support to MX Linux and configure a 2nd network card (Ethernet or Wireless) to broadcast a signal that other machines can connect to.

The process of adding support is drop dead simple and can be done in less than a minute. only 2 packages are required + a couple extra commands if required.
  • If you're using the default MX init called SysVinit, you only need to run items 1 and 4
  • If you're using the optional MX init called SystemD, then you'll need to run all 4 commands
  • If you're unsure, go ahead and run all 4, the 2nd and 3rd will only produce errors and have no adverse effects if you're using MX defaults
As good practice, your system should always be fully updated and you package cache synchronised with the repos before adding any software to your machine. Please check for updates before you install any additional packages.

1) sudo apt install dnsmasq
2) sudo systemctl disable dnsmasq
3) sudo update-rc.d dnsmasq remove
4) reboot

If you're unsure, go ahead and run all 4, the 2nd and 3rd will only produce errors and otherwise have no effect if you're using SysVinit.

The video link is below
https://youtu.be/WeKcWTQc7mY

Additional note: some wireless cards or devices do not support being used as a wifi hotspot. Please check first. Some may not specifically say they support hotspotting but may work nevertheless.

------ EDITED ------ to provide clarity and further instruction re: best practices
Last edited by m_pav on Tue Oct 06, 2020 5:26 pm, edited 3 times in total.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD FX 6100 CPU, nVidia, 8Gb, 3.25TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: Internet Connection Sharing tutorial

#2 Post by Jerry3904 »

Thanks, Mike--glad you followed this up! Will test this later today.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
Adrian
Developer
Posts: 8250
Joined: Wed Jul 12, 2006 1:42 am

Re: Internet Connection Sharing tutorial

#3 Post by Adrian »

HI Mike, thanks for the tutorial, I have a question, why do you need to remove the dnsmasq from starting scripts?

User avatar
m_pav
Developer
Posts: 1390
Joined: Sun Aug 06, 2006 3:02 pm

Re: Internet Connection Sharing tutorial

#4 Post by m_pav »

My understanding maybe flawed, so take this with a grain of salt.
Dnsmasq is a service that enables NAT as is used in routers, and on a larger scale typically used by servers that have act as a firewall and control LAN networks. This service is not needed for daily operation of a desktop system, so there is no need to have it running continually, but it can be called by NM when a card is operating in the sharing mode used by ICS.

One of the things I wanted those more knowledgeable than I to look at is the 2nd command, which is typically used with systemd while we use sysvinit.

My tests show ICS uses the 10.42.0.0 /24 subnet, which is probably the default used by dnsmasq.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD FX 6100 CPU, nVidia, 8Gb, 3.25TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
Adrian
Developer
Posts: 8250
Joined: Wed Jul 12, 2006 1:42 am

Re: Internet Connection Sharing tutorial

#5 Post by Adrian »

I'm not worried about systemd command, it won't hurt with anything on a sysv booted system and it just does the same thing as the other command if you boot with systemd, was just wondering if these 2 commands are needed in the first place. How about "install dnsmasq package and reboot" that should be sufficient to get people going. If they want to remove it from starting automatically they could definitely do that, but it's not a needed step to make it work as far as I understand.

User avatar
m_pav
Developer
Posts: 1390
Joined: Sun Aug 06, 2006 3:02 pm

Re: Internet Connection Sharing tutorial

#6 Post by m_pav »

Right there with you on that one. I personally have no issue with it running either, but keeping things light and tight is always a worthy goal when distributing to the masses.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD FX 6100 CPU, nVidia, 8Gb, 3.25TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Internet Connection Sharing tutorial

#7 Post by JayM »

m_pav wrote: Thu Feb 07, 2019 2:23 pm One of the things I wanted those more knowledgeable than I to look at is the 2nd command, which is typically used with systemd while we use sysvinit.
Probably just delete (or rename) /etc/init.d/dnsmasq and reboot.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

bitfikler
Posts: 43
Joined: Tue Mar 06, 2018 8:04 pm

Re: Internet Connection Sharing tutorial

#8 Post by bitfikler »

Hi all!

I tried this great tutorial and followed all the steps as described. Thank you Mike!

And did it again and did it again. No cigar!

Started googlin' and found the following:

The wifi-card must be able to hav AP - mode! This I found out here:

https://wiki.archlinux.org/index.php/so ... cess_point
This is some one possible result:

$ iw list
Wiphy phy1
...
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point

Running iw -list on MX linux on my computer reveals this program is not installed.

So:
I opened MX package installer
Went to Stable repo
Searched for iw and found it somewhere near the bottom of filtered packages
Installed
Ran it

and got

$ iw list
Wiphy phy0
...
Supported interface modes:
* IBSS
* managed

Conclution:
To make your computer a hot spot first check with iw list to see if you have a wifi card witch support AP.

User avatar
Mustafiz sajib
Posts: 4
Joined: Tue Feb 05, 2019 4:31 pm

Re: Internet Connection Sharing tutorial

#9 Post by Mustafiz sajib »

I found this following your instruction.

Code: Select all

$ iw list
Wiphy phy0
	max # scan SSIDs: 20
	max scan IEs length: 195 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports RSN-IBSS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP-128 (00-0f-ac:4)
		* CCMP-256 (00-0f-ac:10)
		* GCMP-128 (00-0f-ac:8)
		* GCMP-256 (00-0f-ac:9)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * monitor
	Band 1:
		Capabilities: 0x107e
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			No RX STBC
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT Max RX data rate: 300 Mbps
		HT RX MCS rate indexes supported: 0-15
		TX unequal modulation not supported
		HT TX Max spatial streams: 1
		HT TX MCS rate indexes supported may differ
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412 MHz [1] (14.0 dBm)
			* 2417 MHz [2] (14.0 dBm)
			* 2422 MHz [3] (14.0 dBm)
			* 2427 MHz [4] (14.0 dBm)
			* 2432 MHz [5] (14.0 dBm)
			* 2437 MHz [6] (14.0 dBm)
			* 2442 MHz [7] (14.0 dBm)
			* 2447 MHz [8] (14.0 dBm)
			* 2452 MHz [9] (14.0 dBm)
			* 2457 MHz [10] (14.0 dBm)
			* 2462 MHz [11] (14.0 dBm)
			* 2467 MHz [12] (14.0 dBm) (no IR)
			* 2472 MHz [13] (14.0 dBm) (no IR)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * new_station
		 * new_mpath
		 * set_mesh_config
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * set_tx_bitrate_mask
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * set_wds_peer
		 * probe_client
		 * set_noack_map
		 * register_beacons
		 * start_p2p_device
		 * set_mcast_rate
		 * connect
		 * disconnect
		 * set_qos_map
		 * Unknown command (121)
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xd0
	software interface modes (can always be added):
		 * monitor
	interface combinations are not supported
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.
	Device supports SAE with AUTHENTICATE command
	Device supports scan flush.
	Device supports per-vif TX power setting
	Driver supports full state transitions for AP/GO clients
	Driver supports a userspace MPM
	Device supports static SMPS
	Device supports dynamic SMPS
	Device supports configuring vdev MAC-addr on create.

Does this mean I can create Hotspot from my Laptop?
Another thing I used to create Hotspot in my windows 7 to share my internet.
Last edited by Mustafiz sajib on Tue Aug 20, 2019 10:01 am, edited 1 time in total.

User avatar
fehlix
Developer
Posts: 10310
Joined: Wed Apr 11, 2018 5:09 pm

Re: Internet Connection Sharing tutorial

#10 Post by fehlix »

Mustafiz sajib wrote: Fri Aug 02, 2019 10:22 am I found this following your instruction.
@Mustafiz sajib do you mind editing your post and change the [quote] ... [/quote] tags to [code] .. [/code] tags for better readability.
Thanks
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Post Reply

Return to “Community Submissions”