WiFi network sharing

WiFi network sharing

Postby angrybb » 22 May 2015, 03:54

Hi!
Is it possible to share internet from usb WiFi to lan port on R1?
I have a working usb WiFi dongle, using amp_r12 no gui.
I connect to my router with:
Code: Select all
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
ifconfig wlan0 192.168.178.66 netmask 255.255.255.0
route add default gw 192.168.178.1

After this i get ping reply from google.com but i must enter those three commands manualy.
Where should i add those commands to start and connect WiFi automaticaly?

How can i now share this internet to lan port?

Thanks!
angrybb
 
Posts: 5
Joined: 22 May 2015, 03:36

Re: WiFi network sharing

Postby Virtual » 22 May 2015, 07:10

Code: Select all
echo '#!/bin/sh'>/usr/local/etc/rc.init/S90WiFiUp
echo '#'>>/usr/local/etc/rc.init/S90WiFiUp
echo 'export PATH='/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin''>>/usr/local/etc/rc.init/S90WiFiUp
echo 'wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext'>>/usr/local/etc/rc.init/S90WiFiUp
echo 'ifconfig wlan0 192.168.178.66 netmask 255.255.255.0'>>/usr/local/etc/rc.init/S90WiFiUp
echo 'route add default gw 192.168.178.1'>>/usr/local/etc/rc.init/S90WiFiUp
сhmod +x /usr/local/etc/rc.init/S90WiFiUp

как то так.
марсы: HDS7 (смотрелка AMP скин vrt )
HDR12 AMP (обычно сервер с RAM 256 и 2 SATA диска 2T+)//но очень иногда оцифровка видео
XTR PRO(AMP, HTTP(S) NFS SMB FTP сервер +trans2.90 + 2 SATA диска 2T+
сатурны: XTR Prodigy, R6S(512Mb_NAND), HD900A(_MD*) прошивка
User avatar
Virtual
 
Posts: 6862
Joined: 01 Oct 2010, 17:17
Location: RU

Re: WiFi network sharing

Postby angrybb » 22 May 2015, 12:11

Thanks, it works! I was trying something very similar but i didn't exported PATH.

Ok, now the other part, getting internet from WiFi to LAN port.
I am looking at some examples, http://serverfault.com/questions/114657 ... s-bridging and http://raspberrypi.stackexchange.com/qu ... -over-wifi
How does this apply to AMP_12? I ask because i have by default eth0 and eth0:1 interfaces.

Where is the main place to edit default network interfaces?
angrybb
 
Posts: 5
Joined: 22 May 2015, 03:36

Re: WiFi network sharing

Postby FarVoice » 22 May 2015, 13:14

see /usr/local/etc/rcS
and configure eth0 via GUI, or if you use nogui - /usr/share/bin/nogui/do_add script
ASUS O!Play R1 (amp_r12_vrtn), xTreamer Pro (amp_r12_vrt), xTreamer Prodigy (iNeXT 2.14 r2), IconBIT HDR12L (amp_r12_vrt), 3Q F425HW (xds42gl_7725_r3), MyGica A11 (mygica_m3_20121222)
User avatar
FarVoice
Администратор
 
Posts: 8572
Joined: 03 Sep 2010, 01:27
Location: Russia, Moscow

Re: WiFi network sharing

Postby angrybb » 22 May 2015, 15:43

Thanks FarVoice! I managed to setup initial network via /usr/share/bin/nogui/do_add script as i want to use my realtek player without gui.

When i tried to create bridge using brctl comman i got:
Code: Select all
~ # brctl addbr br0
brctl: bridge br0: Package not installed


Which means that bridge support is not included in kernel. I got:
Code: Select all
~ # gunzip < /proc/config.gz | grep BRIDGE
# CONFIG_BRIDGE is not set
CONFIG_W1_DS9490_BRIDGE=m


Can i recompile kernel (where is the source?) or somehow get just needed bridge module or should i seek other method of sharing WiFi to LAN?
angrybb
 
Posts: 5
Joined: 22 May 2015, 03:36

Re: WiFi network sharing

Postby Virtual » 22 May 2015, 19:43

linux-2.6.12.amp12 SRC
но будут проблемы, придется вновь собирать прошивку. (сменить и бинарное ядро)
марсы: HDS7 (смотрелка AMP скин vrt )
HDR12 AMP (обычно сервер с RAM 256 и 2 SATA диска 2T+)//но очень иногда оцифровка видео
XTR PRO(AMP, HTTP(S) NFS SMB FTP сервер +trans2.90 + 2 SATA диска 2T+
сатурны: XTR Prodigy, R6S(512Mb_NAND), HD900A(_MD*) прошивка
User avatar
Virtual
 
Posts: 6862
Joined: 01 Oct 2010, 17:17
Location: RU

Re: WiFi network sharing

Postby angrybb » 26 May 2015, 20:37

Just to report back.
After a lot of compilation and a lot of trial and error configs, different toolchains, bash scripts etc. I finaly made it!

Just typing this from my laptop conected to my emtec movie cube s120h via lan cable(udhcpd).
S120h is connected wirelessly(static ip) over some verry bugy realtek usb wifi(which is like 100°C hot and my fail while i am typing this :) )

BIG THANKS to Virtual for kernel sources and toolchain and FarVoice for "logistics".

Now i can disconnect all this and continue with normal life :)

Maybe i will document all this at some point, but it is heavy "black magic" stuff.
Bridging seemed easier at first but i ended up compiling netfilter(iptables) into the kernel and then static compiling iptables userspace program.
angrybb
 
Posts: 5
Joined: 22 May 2015, 03:36

Re: WiFi network sharing

Postby FarVoice » 26 May 2015, 21:06

You are real shaman :)) Your dancing with a tambourine and eaten two kilograms of fly agaric paid off
ASUS O!Play R1 (amp_r12_vrtn), xTreamer Pro (amp_r12_vrt), xTreamer Prodigy (iNeXT 2.14 r2), IconBIT HDR12L (amp_r12_vrt), 3Q F425HW (xds42gl_7725_r3), MyGica A11 (mygica_m3_20121222)
User avatar
FarVoice
Администратор
 
Posts: 8572
Joined: 03 Sep 2010, 01:27
Location: Russia, Moscow

Re: WiFi network sharing

Postby angrybb » 26 May 2015, 21:39

Well i had to read buildroot manual, which was very interesting ant to the points that interested me. I tried to escape reading but as always, rtfm is the king :)

[facepalm]But now i saw that i enabled my printer (or anything else connected on s120h lan port) reach the internet, but other devices in my home wifi have no acces to printer, which was the starting idea. [/facepalm] :roll:

I guess it can be achived with couple of "iptables -t nat xxx" commands, but those guys at #netfilter@freenode (where i intended to ask for help) have put very interesting "read before you ask" links in topic, and it seems nat is the wrong aproach to almost anything. :)
angrybb
 
Posts: 5
Joined: 22 May 2015, 03:36


Return to Other

Who is online

Users browsing this forum: No registered users and 9 guests