How do I share a wireless network connection with a wired device ?

Sam Varshavchik mrsam at courier-mta.com
Fri Nov 13 01:25:39 UTC 2009


Linuxguy123 writes:

> 
> In system-config-firewall.py, I did the following:
> 
> - trusted the wired Ethernet port.
> - trusted DNS and Multicast DNS
> - turned on masquerading for the wired ethernet port
> - applied all these
> 
> In spite of all this my device is not getting an IP address.   What am I
> missing ?

I say you're missing the correct configuration for your wired segment, and 
you're missing a DHCP server.

> I guess what I am asking is, how do I tell the laptop to serve addresses
> to clients on the wired Ethernet port ?

For starters, you need to assign a static IP address for your wired 
interface. Your narrative did not include the low-level configuration 
details of both your wired and your wireless interfaces. I'm guessing that 
you probably configured both your wired and your wireless interfaces to use 
automatic settings. That works for wireless, since your wireless address 
point is handing your laptop an IP address. That won't work for your wired 
segment, since there's nothing on your wired segment to give your laptop an 
IP address for its wired network interface, all you have is some dumb device 
there. Your laptop needs to take charge of the wired segment, and run the 
whole show.

Presuming that your access point is assigning your laptop an IP address in 
the 192.168.0.0/24 range, the logical netblock for your wired segment would 
be 192.168.1.0/24, so you'll need to configure your laptop's wired interface 
to a static netblock of 192.168.1.0, and a static IP address of 192.168.1.1.

You do that in Network Configuration. Bring up "Network Configuration", and 
edit your wired interface address.

Turn off all options, including "Controlled by NetworkManager". Turn on 
"Activate device when computer starts", select "Statically set IP 
addresses", put in an address of 192.168.1.1, subnet mask 255.255.255.0, and 
leave the gateway address blank, together with all the DNS fields.

If, on the other hand, your wireless access point is giving your wireless 
interface an 192.168.1.x netblock IP address, you'll just need to turn 
around and set up your wired interface to use the 192.168.0.0/24 range 
instead. Your wired and your wireless interfaces must be on different 
netblock segments, and your laptop bridges the two. That's how it works.

Then:

yum install dhcp

chkconfig on dhcp (so that dhcp starts when you boot your laptop).

man dhcpd.conf

(a lot of reading goes here)

emacs /etc/dhcp/dhcpd.conf

You probably need to do add something like this in your dhcpd.conf file 
(presuming that you're using 192.168.1.0/24 for your wired segment):

subnet 192.168.1.0 netmask 255.255.255.0 {

        option subnet-mask              255.255.255.0;

        allow unknown-clients;

        option routers                  192.168.1.1;
        option domain-name-servers      192.168.1.1;

        range 192.168.1.129 192.168.1.159;

        default-lease-time 604800;
        max-lease-time 604800;
}

Since, as you say, you're using dnsmasq, you'll need to tell your DHCP 
client (your wired device), that your wired interface's IP address is going 
to be its DNS server (option domain-name-servers), also that your wired 
device needs to use your wired interface as its router (option routers).

Oh, and you'll probably need to reboot, too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20091112/3ab49a9d/attachment-0001.bin 


More information about the users mailing list