bridging wlan0 to eth0 in wicd
bridging wlan0 to eth0 in wicd
I want to share, ocasionally, the existing internet connection done by wifi (wlan0) to another computer using the ethernet (eth0). But i don't see an easy way to do that with wicd (?) May be i'm missing something.
Googling a bit gave me some infos which are more or less commandline oriented (some editing of dhcp conf files etc.). The best seemed to me the debian wiki bridging. In any case i tried their suggestions (i also installed bridge-utils). But i could not add wlan0 to the created bridge (like they suggested i called it br0).
I hesitate a bit to change in deep the config files in /etc/ because i do not want to break something. Actually, the best would be a simple way to share the connection "on the fly" with wicd
Thanks in advance for any help!
Googling a bit gave me some infos which are more or less commandline oriented (some editing of dhcp conf files etc.). The best seemed to me the debian wiki bridging. In any case i tried their suggestions (i also installed bridge-utils). But i could not add wlan0 to the created bridge (like they suggested i called it br0).
I hesitate a bit to change in deep the config files in /etc/ because i do not want to break something. Actually, the best would be a simple way to share the connection "on the fly" with wicd
Thanks in advance for any help!
Re: bridging wlan0 to eth0 in wicd
In case you get no answer here, try at https://answers.launchpad.net/wicd
Help to make Slackware easier Donate to Salix
Re: bridging wlan0 to eth0 in wicd
Thanks for the hint. I did a quick research but did not find anything (or better: 2 questions, expired because there were no reply)zAchAry wrote:In case you get no answer here, try at https://answers.launchpad.net/wicd
A small footnote: I remember - with wicd - i succeeded once (long time ago) in sharing a wireless connection with (on laptop running debian) by ethernet (to a Macintosh). So, i think there will be a way ...
Re: bridging wlan0 to eth0 in wicd
I don't think wicd supports that.
The instructions you have should probably work though. If you could point to them, maybe we could find what's wrong.
Don't be afraid of editing the configuration files in /etc. You could always make a backup before editing, which you could restore if anything goes wrong.
Another possibility would be to replace wicd with NetworkManager. You'll also need the network-manager-applet package of course. I think that includes functionality for sharing connections (but haven't confirmed or ever used it myself).
The instructions you have should probably work though. If you could point to them, maybe we could find what's wrong.
Don't be afraid of editing the configuration files in /etc. You could always make a backup before editing, which you could restore if anything goes wrong.
Code: Select all
sudo cp /etc/example /etc/example.bak
Re: bridging wlan0 to eth0 in wicd
Thanks to you gapan. I'll try.
Another way would be to use "ceni" (a commandline tool created by the aptosid people, which i like a lot - and would love to be able use it with Salix. Look here: http://www.linux.org/threads/ceni.7668/). There is a tar.xz file, but i do not know how to make it "slackware friendly" ... (?)
Another way would be to use "ceni" (a commandline tool created by the aptosid people, which i like a lot - and would love to be able use it with Salix. Look here: http://www.linux.org/threads/ceni.7668/). There is a tar.xz file, but i do not know how to make it "slackware friendly" ... (?)
Re: bridging wlan0 to eth0 in wicd
Well, here's a package: http://pnboy.pinguix.com/gapan/salix/ceni/
But, it won't work just like that. It has several (it seems) perl dependencies which you'll need to install first. It needs at least Expect and Pty, maybe more... You can try installing them with cpan, for example:
(the first time you run cpan there will also be some configuration steps).
and then try to launch it from a terminal:
see if you get any error messages for missing modules and install them the same way.
Not sure it's worth all the trouble.
But, it won't work just like that. It has several (it seems) perl dependencies which you'll need to install first. It needs at least Expect and Pty, maybe more... You can try installing them with cpan, for example:
Code: Select all
cpan Expect
and then try to launch it from a terminal:
Code: Select all
sudo Ceni
Not sure it's worth all the trouble.
Re: bridging wlan0 to eth0 in wicd
Seems that it only needs Expect to run, but the bad news is that Ceni seems to be written for Debian and will not work on Slackware. Ceni tries to read the interfaces file in the /etc/neworks directory, which doesn't exist in slackware base distro.
“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"
Re: bridging wlan0 to eth0 in wicd
That's correct: It's an Aptosid program. Ok, i understand. It's a pity but it's like this
Thanks to you both, for helping! Tomorrow i'll try the wicd way
Re: bridging wlan0 to eth0 in wicd
This is called masquerade. I have used this, many years before, to share a dial-up to another pc connected with a crossover cable.
My laptop is connected wireless on internet.
I want to share my connection to the other pc.
I used a dedicated switch where i connect both my laptop and my pc. This has been tested.
Or can use a crossover cable to connect laptop and pc. I have not checked this.
On LAPTOP which is connected to internet with wireless
1. Create a file masq.sh and add the following exactly, in the end of file.
2. install dnsmasq so your client pc should take an address using dhcp. So you can share your wireless connection to many pc's. In a common switch can use 7 pc's.
3. Edit the file /etc/dnsmasq.conf
and add these lines in the end.
4. start the dnsmasq
On every boot just type on laptop
on client pc type for testing. ( this not need on every boot of client pc. It will pick up an ip from dhcpcd)
Open a browser on client pc and you are on internet.
On my laptop typing the command sudo route i get
On client pc
Of cource can use wicd on client pc. It will pick up an ip from wired net.
My laptop is connected wireless on internet.
I want to share my connection to the other pc.
I used a dedicated switch where i connect both my laptop and my pc. This has been tested.
Or can use a crossover cable to connect laptop and pc. I have not checked this.
On LAPTOP which is connected to internet with wireless
1. Create a file masq.sh and add the following exactly, in the end of file.
Code: Select all
#!/bin/sh
#
#Share my wireless connection to eth0
#Assuming wlan0 is your wireless WAN port, e.g. the laptop) and eth0 is your LAN port e.g your client PC
#and that you have connected your client PC to your host PC Laptop via a dedicated switch or (with a crossover ethernet cable)
ifconfig eth0 down
ifconfig eth0 192.168.10.1 netmask 255.255.255.0
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -F FORWARD
iptables -A FORWARD -j ACCEPT
iptables -nvL
2. install dnsmasq so your client pc should take an address using dhcp. So you can share your wireless connection to many pc's. In a common switch can use 7 pc's.
Code: Select all
sudo slapt-get -i dnsmasq
Code: Select all
sudo geany /etc/dnsmasq.conf
Code: Select all
interface=eth0
dhcp-range=192.168.10.10,192.168.10.19,4h
Code: Select all
sudo service start dnsmasq
Code: Select all
sudo sh masq.sh
Code: Select all
sudo dhcpcd
On my laptop typing the command sudo route i get
Code: Select all
djemos[~]$ sudo route
Password:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default dsldevice.lan 0.0.0.0 UG 0 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
Code: Select all
djemos[~]$ sudo route
Password:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.10.1 0.0.0.0 UG 202 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.10.0 * 255.255.255.0 U 202 0 0 eth0
Code: Select all
djemos[~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.16 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 fe80::6ab5:99ff:fe66:a8c prefixlen 64 scopeid 0x20<link>
ether 68:b5:99:66:0a:8c txqueuelen 1000 (Ethernet)
RX packets 3063 bytes 2232352 (2.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2891 bytes 325686 (318.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code: Select all
djemos[~]$ cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
nameserver 192.168.10.1
# /etc/resolv.conf.tail can replace this line
Re: bridging wlan0 to eth0 in wicd
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?
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).
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?
As for the rest,seems clear to me.
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?
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).
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?
As for the rest,seems clear to me.