Page 2 of 2
Re: bridging wlan0 to eth0 in wicd
Posted: 6. Oct 2015, 04:54
by djemos
jsfarinet wrote:Wow,impressive. Thanks a lot.
Just a question regard the range: Is it necessary to give to the guest (the pc connected to the laptop with the i-net connection) a different net than that running between laptop and gateway/router? In your example, as i understand, your local net to the router runs as 192.168.1.* and the net given to the guest (by dnmasquerade) is 192.168.10.* Correct?
Yes. They cannot have the same i-net address.
Would the connected pc pick up the line without any explicite configuration? (In my case i'd like to share the line, to install a *bsd on an old hp laptop where the built-in wifi is not working out of the box).
Yes. Because of dhcp running on the connected pc.
Finally, should i make the masq.sh file executable? And, why should i call it by sudo, when it is a local (user related file)? Because the instructions in it need superuser power?
Yes can make it executable. You have to run it after wlan0 is up and has an internet ip. Otherwise eth0 will be used and wlan0 will not take an ip.
You have to use sudo because the iptables etc need a super user or root to be executed.
Re: bridging wlan0 to eth0 in wicd
Posted: 6. Oct 2015, 06:07
by jsfarinet
Ok, i hope i got it all. Excellent lesson in networking. Thanks a lot djemos!
PS. Although, the question could be considered as solved: Since wicd allows handling scripts from within would it be possible to define the dnsmasq on/off and the masq.sh commands as a script to be executed eventually from wicd? (Obviously,there should be there dnsmasq and the edit conf file).
Re: bridging wlan0 to eth0 in wicd
Posted: 6. Oct 2015, 08:49
by jsfarinet
I'm still having a problem.
Before all, i've slightly different settings for the local gateway and wlan (which is in the 192.168.10.* range). So i changed in masq.sh and /etc/dnsmasq.conf the values consequentely to 192.168.2.* I think that's coherent (?).
But anyway "sudo route" on the laptop (with the wifi connection to the router/modem) gives me:
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default <routername> 0.0.0.0 UG 303 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
169.254.0.0 * 255.255.0.0 U 202 0 0 eth0
169.254.34.221 localhost 255.255.255.255 UGH 202 0 0 lo
192.168.10.0 * 255.255.255.0 U 303 0 0 wlan0
darkstar localhost 255.255.255.255 UGH 303 0 0 lo
And i cannot establish a connection on the pc ...
Re: bridging wlan0 to eth0 in wicd
Posted: 6. Oct 2015, 11:46
by djemos
Your wlan0 has ip like 192.168.10.* range
So try this
on masq.sh
change the second line to
Code: Select all
ifconfig eth0 192.168.20.1 netmask 255.255.255.0
and on dnsmasq.conf
Code: Select all
interface=eth0
dhcp-range=192.168.20.10,192.168.20.19,4h
Your eth0 does not take a net range in your output. You did or typed something wrong.
169.254.0.0 *
255.255.0.0 U 202 0 0 eth0
it should be 4 class net 255.255.255.0
Re: bridging wlan0 to eth0 in wicd
Posted: 6. Oct 2015, 13:29
by djemos
jsfarinet wrote:Ok, i hope i got it all. Excellent lesson in networking. Thanks a lot djemos!
PS. Although, the question could be considered as solved: Since wicd allows handling scripts from within would it be possible to define the dnsmasq on/off and the masq.sh commands as a script to be executed eventually from wicd? (Obviously,there should be there dnsmasq and the edit conf file).
yes it is working so you dont have to run it every time laptop reboot
Code: Select all
sudo cp masq.sh /etc/wicd/scripts/postconnect/masq.sh
sudo chmod 755 /etc/wicd/scripts/postconnect/masq.sh
When you execute this command for the first time on laptop
dnsmasq will always turn on at every boot. So you don't have to do anything more about it.
Re: bridging wlan0 to eth0 in wicd
Posted: 8. Oct 2015, 07:42
by jsfarinet
djemos, first of all thanks a lot for you patience. But still i've problems with sharing the wifi connection over ethernet. I'll come back this evening to report "en detail". Just for the moment, guessing in the dark:
Could there be a problem since i'm running - locally (=on localhost) - privoxy which the forwards to tor ?
Re: bridging wlan0 to eth0 in wicd
Posted: 8. Oct 2015, 16:09
by djemos
I don't know.
But to turn your system as it was before
comment the two lines in dnsmasq.conf
or remove dnsmasq
Code: Select all
sudo sysctl -w net.ipv4.ip_forward=0