Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #4108

Re: Internet Connection Sharing

From Aleksandar Kuktin <ak@triklod.rs>
Newsgroups comp.os.linux.networking
Subject Re: Internet Connection Sharing
Date 2018-02-16 14:21 +0000
Organization Aioe.org NNTP Server
Message-ID <p66pdm$q1a$2@gioia.aioe.org> (permalink)
References <p66ntv$sie$1@gioia.aioe.org>

Show all headers | View raw


On Fri, 16 Feb 2018 08:56:16 -0500, J.B. Wood wrote:

> Hello, all.  I have a question directed to anyone who has actually done
> the following:
> 
> 1.  A Fedora or CentOS (I use both) platform is connected to the
> internet via Cat5 cable, IOW not using wifi.  However, this Linux
> platform does have wifi capability.
> 
> 2.  It is desired to setup up the Linux platform as a wifi hotspot
> (wirelss NAT) such that a wifi enabled Windows 7 platform can share the
> Linux platform's connection to the internet.  DHCP provided by the Linux
> box would be convenient but assigning a static IP address, netmask, and
> default gateway to the Win7 platform is just as easy.
> 
> 3.  The above is easily accomplished when all the platforms are Windows.
>   I also can readily share a Win7 internet-connected platform witn a
> Linux box via wi-fi but that's the reverse of what I want to accomplish.
>   Your time and comment is greatly appreciated.  Sincerely,

Did you figure out how to set Linux as the Access Point? I did it long 
ago, and don't remember all the details anymore.

As for the network configuration in Linux, assume eth0 is your outside 
interface. Assume 123.123.123.123/24 is the IP address/mask on there. 
Assume wlan0 is the inside interface. Assume 10.0.0.1/8 is the address/
mask on the inside.

The Windows box (or any internal machine for that matter) should have an 
address in the subnet 10.0.0.0/8 - to be able to find 10.0.0.1 
independently. It's default IP route should point towards 10.0.0.1 .

First, set up the NAT for the linux box:
iptables -I POSTROUTING -o eth0 -s 10.0.0.0/8 -j MASQUERADE

Then enable routing:
echo 1 > /proc/sys/net/ipv4/ip_forward

It should work with this setup.

To make it permanent, use iptables-save to save you current firewall 
configuration to a file and iptables-restore to load it back up. Use /etc/
sysctl.conf to save IP forwarding (line should look like 
'net.ipv4.ip_forward = 1').

Back to comp.os.linux.networking | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Internet Connection Sharing "J.B. Wood" <arl_123234@hotmail.com> - 2018-02-16 08:56 -0500
  Re: Internet Connection Sharing "Jonathan N. Little" <lws4art@gmail.com> - 2018-02-16 09:17 -0500
  Re: Internet Connection Sharing Aleksandar Kuktin <ak@triklod.rs> - 2018-02-16 14:21 +0000

csiph-web