Author Topic: [SOLVED] possible to rebroadcast wifi for my nintendo DS?  (Read 1421 times)

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
[SOLVED] possible to rebroadcast wifi for my nintendo DS?
« on: December 20, 2011, 04:31:55 PM »
so here's my situation. im at my apartment, and roomate owns the router, which i cant change the settings on. it's got static ip addresses, and is encrypted with a wpa encryption. I can connect to that fine with my laptop, but what i cant connect with is my nintendo DS. the DS can only connect to unsecured and wep connections, and since i cant change the router settings im in a bit of a pickle trying to get it to connect (i should also note that i cant find anywhere in town, either public or a friends house that has a wifi connection i can use, it's kinda ridiculous). so i'm trying to find a way to rebroadcast a wifi signal in either unencrypted or wep, either way doesnt matter, i only need it for all of 1 minute. i have tried countless ways in windows 7, and i just cant quite seem to get anything to work, and i figured i would try my main linux as well, but i have no idea where to start.

If needed i can connect via a ethernet cable to the main router (which i tried in windows unsccesfully), i also have a spare router available that i can try using to rebroadcast (which i also tried, and also tried plugging it into the other router, but neither way worked). ive tried many other methods, but none in linux, so if anyone had an idea as to how i might be able to do this, i'm all ears :-)
« Last Edit: January 24, 2012, 08:48:44 PM by phantom16 »

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #1 on: December 20, 2011, 04:51:39 PM »

Your computer will need to have atleast two interfaces.

From your description. I think it will be easiest if you could do the following:

1. Connect your computer to your friend's router and make sure internet works.

2. Connect your local router to your computer.

3. Set up your computer to pass on traffic btw your router and your friend's router.

4. Connect your DS to your router.

The difficult part will be in passing traffic through your computer.

Run below command and give your output, you should have atleast 3 entries including the loop interface. Specify what interface will be connected to your friend's router and which one to yours.

ifconfig

Run below command and give your output

cat /proc/sys/net/ipv4/ip_forward
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #2 on: December 22, 2011, 12:08:37 AM »
ifonfig
Quote
eth0      Link encap:Ethernet  HWaddr B8:70:F4:7F:71:27
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10160 (9.9 KiB)  TX bytes:10160 (9.9 KiB)

wlan0     Link encap:Ethernet  HWaddr C0:F8:DA:54:D1:FF
          inet addr:10.0.1.164  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::c2f8:daff:fe54:d1ff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:474114 errors:0 dropped:0 overruns:0 frame:0
          TX packets:399843 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:530382996 (505.8 MiB)  TX bytes:88359357 (84.2 MiB)


so i guess the eth0 is my ethernet port, so that would be connected to my router, and the wlan0 is the wireless, currently connected to my friends router. (i have no idea what the "lo" connection is)


cat /proc/sys/net/ipv4/ip_forward
Quote
0

just 0, nothing else for that command...

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #3 on: December 22, 2011, 04:51:29 AM »
cat /proc/sys/net/ipv4/ip_forward
Quote
0

just 0, nothing else for that command...

It has to have a value of "1" to allow traffic to flow from "eth0" to "wlan0" interface and vise versa.

Open the terminal, log in as root and then run this command to change the value to "1". The change will not survive reboot and we will discuss this when things work.

echo -n 1 > /proc/sys/net/ipv4/ip_forward

The command in my previous post should now give you "1".

Go to pcc and give the "eth0" interface the following network properties(you can choose your own if you how how to set them up)

IP address(static) : 10.10.10.10
netmask: 255.255.255.0

go to your router that connects to this interface and give it a static IP address of "10.10.10.20" and netmask of "255.255.255.0" if the option is there. You will have to set up a dhcp server on "eth0" if the router does not have the ability to set its IP address statically.

Connect the router to the interface and it should now work. Traffic should be able to flow from wlan0 to eth0 to your router and to whatever device is connected to the router and vice versa.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #4 on: January 10, 2012, 10:01:44 PM »
ok, sorry for taking so long to get back to this, i have been out of town for the holidays, but now im back and still wanting to get online with my DS.

So i put in the code you said, and got the other code to say "1" no problem. i then configured my router with a static ip and subnet of what you told me to, but my router won't let me save it unless i also put in a gateway and dns. i fiddled around with some numbers until i got something it accepted (otherwise it kept rejecting it saying it was out of range or something along those lines), which was a gateway of 10.10.10.20 and a dns of 8.8.4.4. I have no idea if thats even the ones i should be doing, but i dont know what numbers i should. but so i did that, and when i connect to both my wireless rommates router and my router connected via the eth0 it still doesnt work. (i should mention when i am connected to both, i cant actually surf the internet on my laptop anymore, not sure if that is normal or not?)

since i had to put in the gateway and dns for my static router, i also put that same info in for my eth0 connection when i configure it. if i leave them out then when i click connect it just says connecting for a couple seconds and then the box goes away and i'm still not connected. When i have my laptop connected to both the routers, i tried logging in on my router via my rommates laptop, just to see if its working (as to maybe rule out a problem with specifically getting the DS to work), but it didnt work there, leading me to beleive the internet is passing correctly through my laptop to my router. maybe something to do with the gateway/dns info?

soooo, it didn't work, not sure what you recommend i do now?

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #5 on: January 11, 2012, 01:14:49 PM »
my bad, my post was incomplete.

Here is one additional info i should have included.

run this command on your computer in addition to the echo one given above

iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

on your router, it should have the following network properties
ip address: 10.10.10.20
netmask: 255.255.255.0
gateway: 10.10.10.10
DNS: 8.8.8.8
try now and see if it will work
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #6 on: January 11, 2012, 01:21:46 PM »
ifonfig
Quote
eth0      Link encap:Ethernet  HWaddr B8:70:F4:7F:71:27
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10160 (9.9 KiB)  TX bytes:10160 (9.9 KiB)

wlan0     Link encap:Ethernet  HWaddr C0:F8:DA:54:D1:FF
          inet addr:10.0.1.164  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::c2f8:daff:fe54:d1ff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:474114 errors:0 dropped:0 overruns:0 frame:0
          TX packets:399843 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:530382996 (505.8 MiB)  TX bytes:88359357 (84.2 MiB)


so i guess the eth0 is my ethernet port, so that would be connected to my router, and the wlan0 is the wireless, currently connected to my friends router. (i have no idea what the "lo" connection is)

lo is a local interface. It is there to allow programs running on the computer to talk to other programs running on the same computer using network infrastructure as if they are talking to programs on different computer over the network.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #7 on: January 19, 2012, 01:05:48 PM »
egh...still cant get it to work
i have run both:
echo -n 1 > /proc/sys/net/ipv4/ip_forward (and successfully gotten "1")
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

router has these settings for incoming internet:
ip address: 10.10.10.20
netmask: 255.255.255.0
gateway: 10.10.10.10
DNS: 8.8.8.8

my etho connection is:
ip address: 10.10.10.10
netmask: 255.255.255.0
gateway: 10.10.10.10
DNS: 8.8.8.8
(note: if i leave the gateway and dsn blank, it doesnt seem to connect, just says "connecting" then stops)

I then connect both eth0 and wlan0. internet doesnt work on laptop (presumably pushing through to router), but i just still cant get it to work. any other ideas?

p.s. thanks so much with your help so far :-)

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #8 on: January 19, 2012, 09:04:43 PM »
my bad ( again  :-\ )

Let me start afresh, paying attention this time.

Your router should have the following network properties:

IP address: 10.10.10.20
netmast: 255.255.255.0
gateway:10.10.10.10
DNS: 8.8.8.8

eth0 should have the following network properties:
IP address: 10.10.10.10
netmask: 255.255.255.0
gateway: YOUR FRIEND'S ROUTER GATEWAY ADDRESS <--- edit, leave this place blank, not needed
start by not having the gateway address on eth0, i dont think its necessary but If you do want to have it, then it must be the same as that on wlan0.

If you are unsure of the gateway address, run "route -n" command and the address at the bottom of the "gateway" column. You must run the command when wlan0 is connected to your friend's wireless router.

Set up what is above and then run these two commands

echo -n 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -o wlan0 -j MASQUERADE

I made a mistake on the last command,it should have been on wlan0, not eth0

I have the same set up here so i know this setup works. The only difference btw yours and mine is that you have a router on your eth0 side of the network and i have a hub.
« Last Edit: January 24, 2012, 03:16:33 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #9 on: January 23, 2012, 07:18:26 PM »
lol, man is this proving to be difficult!  ;D
so i have my router with the settings stated
but then if i change my eth0 settings to what you said (the gateway is currently 10.0.1.15) then it just fails to connect, even with a DNS of 8.8.8.8, 8.8.4.4, or just left blank.

maybe i should mention the router settings of my friends, it's:
ip addr:   10.0.1.X               (the x is just whatever number that's not already taken, my specific one for my laptop is .164)
subnet mask:   255.255.255.0
default gateway:10.0.1.15
dns server:   8.8.4.4

So i noticed i could only connect to my router when eth0 had the same gateway settings as the router, so since you said to use my friends gateway for my eth0 connection, i tried to see what happens if i changed my router gateway to the same thing, but no-go, just says: "WAN Gateway IP address 10.0.1.15 must be within the WAN subnet." so i guess my router won't let me pick that as a gateway...

so, yea, again, not working, but this time i can't connect to my router when i have eth0 with my friends gateway, any ideas?

and if it helps or not, my router is a d-link dir-655

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #10 on: January 24, 2012, 02:18:09 PM »
edit to give a short summary after i wrote and posted all that is below.

"Connection failed msg" when setting up eth0 should be expected for reasons mentioned in below posts. Just run with the setup ignoring the error message and try to go online with your DS, check your DS internet connectivity, not pcc complains to see if things work or not

for your convenience, the instructions to follow are in this thread:

http://www.pclinuxos.com/forum/index.php/topic,100921.msg866927.html#msg866927


I dont understand why its not working, i have the same setup, though i have a hub where you have a router but the principle should be the same as both the hub and router  just pass through traffic, a router though does more by masquerading the traffic from its other end.

This is my set up.

Computer A.
wlan0 interface is connected to the wireless network from the other room.
eth0 is connected to a hub through a cable.

Computer B( where i am typing this from) is connected to the hub. When i click send here, the traffic will flow from this computer, to the hub,to eth0 on computer A, to wlan0 on computer A, to the wireless access point and then to the ISP on its way to pclinuxos server.

As you can see, the only difference btw what i have and what you have is that i use a hub btw the two computers and you use a router,i havent tested it with a router but i think it should work since the general network properties are the same.

This my interface properties on computer A.
Quote
[root@mtz ink]# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
BOOTPROTO=static
IPADDR=10.10.10.100
NETMASK=255.255.255.0
GATEWAY=10.10.10.1
ONBOOT=yes
METRIC=35
MII_NOT_SUPPORTED=no
USERCTL=yes
DNS1=127.0.0.1             <---------DNS could be 8.8.8.8,(why i have a local address here shouldnt be relevant)
RESOLV_MODS=no
WIRELESS_MODE=Managed
WIRELESS_ESSID=<masked>
WIRELESS_ENC_KEY=<masked>
WIRELESS_WPA_DRIVER=wext
WIRELESS_WPA_REASSOCIATE=no
IPV6INIT=no
IPV6TO4INIT=no
ACCOUNTING=yes


Quote
[root@mtz ink]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.10.100.100
NETMASK=255.255.255.0
GATEWAY=10.10.10.1      <------gateway address of  the wireless network
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=yes
DNS1=8.8.8.8
RESOLV_MODS=no
IPV6INIT=no
IPV6TO4INIT=no
ACCOUNTING=yes


Network properties on the computer B.(winxp computer,output of ipconfig)
Quote
Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . :

        IP Address. . . . . . . . . . . . : 10.10.100.200

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 10.10.100.100



Notice the IP addresses on the same colors have the same numbers to the left of  the last dot and their interfaces are the ones connected through the hub(in my case) and router in yours.

If things do not work, then either we are making a mistake somewhere or the setup doesnt work with a router(cant see why if this is true)

what is the output of these two commands?( post them,dont just explain them)
Quote
cat /proc/sys/net/ipv4/ip_forward
iptables -t nat -L -v

The first command should give you "1"

The second one should have something like below(relevant part is in red)
Quote
[root@mtz ink]# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 388K packets, 55M bytes)
 pkts bytes target     prot opt in     out     source               destination        

Chain INPUT (policy ACCEPT 192 packets, 25768 bytes)
 pkts bytes target     prot opt in     out     source               destination        

Chain OUTPUT (policy ACCEPT 134K packets, 8571K bytes)
 pkts bytes target     prot opt in     out     source               destination        

Chain POSTROUTING (policy ACCEPT 17126 packets, 2920K bytes)
 pkts bytes target     prot opt in     out     source               destination        
17229 1190K MASQUERADE  all  --  any    wlan0   anywhere             anywhere

« Last Edit: January 24, 2012, 03:14:42 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #11 on: January 24, 2012, 03:01:12 PM »
lol, man is this proving to be difficult!  ;D
so i have my router with the settings stated
i hope so, i suspect we are making a mistake somewhere and thats why things dont work.

but then if i change my eth0 settings to what you said (the gateway is currently 10.0.1.15) then it just fails to connect, even with a DNS of 8.8.8.8, 8.8.4.4, or just left blank.
Explanation for this is below.

maybe i should mention the router settings of my friends, it's:
ip addr:   10.0.1.X               (the x is just whatever number that's not already taken, my specific one for my laptop is .164)
subnet mask:   255.255.255.0
default gateway:10.0.1.15
dns server:   8.8.4.4
Good, now we know your friend's wireless network gateway address,its 10.0.1.15.
Most routers use their IP address as their gateway address. Your friend's router behave differently but it shouldnt matter.

So i noticed i could only connect to my router when eth0 had the same gateway settings as the router, so since you said to use my friends gateway for my eth0 connection
I did not anticipate this. When you setup network properties through pcc, it checks for the router and gives a "connection failed" msg when it cant find any. You do not want eth0 to send its traffic to your router, you want your router to send its traffic to eth0. "Connection failed msg" here should be expected because your use case contradicts the normal usage of the tool.

What is in red is very important part of  the network setup you are trying to make.

, i tried to see what happens if i changed my router gateway to the same thing, but no-go, just says: "WAN Gateway IP address 10.0.1.15 must be within the WAN subnet." so i guess my router won't let me pick that as a gateway...
Expected, your computer is acting as a router here connecting network 10.0.1.x/24(your friend's network) and 10.10.10.x/24(your local network).

The iptable command you have to run "hides" traffic from your local network because your friend's network will see it as foreign and drop it.

Your router is on 10.10.10.x/24 network and should not have any address that starts with 10.0.1.x

so, yea, again, not working, but this time i can't connect to my router when i have eth0 with my friends gateway, any ideas?
Explanation for this is above. eth0 is not connecting to your router, your router is connecting to eth0. Notice the gateway address of your router is the IP address of eth0. This is very important point to understand.

If you understand how traffic flows, you will see that eth0 does not need a gateway address and my initial advice was for it not to have any. Your DS will send its traffic to your router, your router will send it to eth0, the computer network infrastructure will see where it should send the traffic and will see that gateway address is on wlan0 interface, the traffic will be sent to that interface and the interface will send it to your friend's router.

The echo command is important because it allows traffic to flow btw eth0 and wlan0

the iptable command is important because it hides your local network traffic from your friend's network.

Your local network runs on 10.10.10.x/24
Your friend's network runs on 10.0.1.x/24
« Last Edit: January 24, 2012, 03:04:37 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #12 on: January 24, 2012, 05:38:50 PM »
 ;D ;D ;D ;D ;D
yay! it's working, i can finally get online with my pokemon!!!! lol, thank you sooooo much!!! so a few things i was doing wrong, that i guess we figured out, but just so in case someone else wants to know if they ever try something like this.
first i'll just review everything so that we all can see my address':

wlan0: (which is static)
ip addr: 10.0.1.164
subnet mask:   255.255.255.0
default gateway: 10.0.1.15
dns server:   8.8.4.4

eth0:
ip addr: 10.10.10.10
subnet mask:   255.255.255.0

router settings:
ip address: 10.10.10.20
netmask: 255.255.255.0
gateway: 10.10.10.10
DNS: 8.8.8.8

ds settings:
ip: 10.10.10.20
subnet: 255.255.255.0
gateway: 10.10.10.10
dns: 8.8.4.4

so now for a couple things i was doing wrong, so hopefully someone else in the future, so hopefully they don't do them wrong lol
1. i had my cable running from my eth0 port into the "internet" port of my router, didn't work. having it plugged into just one of the normal lan ports is what was needed.
2. since it's a router, and not a switch, disable DHCP!
3. yea i kept thinking i had to have both wlan0 and eth0 connected at the same time, but i guess not lol, that's normal, good to know :-)


and a couple follow up questions, so for this command:
iptables -t nat -I POSTROUTING -o wlan0 -j MASQUERADE
do i need to ever do that again?

because you said i need to redo:
echo -n 1 > /proc/sys/net/ipv4/ip_forward
every time i reboot, correct? and i dont have a problem with that lol


Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #13 on: January 24, 2012, 05:57:48 PM »

glad you got it working and my apologies for writing too much, i try to write short posts i get carried away sometimes.

Those commands can be set to survive reboots.

Open a text file "/etc/sysctl.conf" and it should have the following line somewhere:

net.ipv4.ip_forward = 0

Change the line to:

net.ipv4.ip_forward = 1

If the line is not there, add it.

NOTE: You must open the text file with a text editor running from root's account or you wont be able to save your changes.

When on the terminal as root,run this command

service iptables save

The above command will save the iptable rule you just added and hence will survive reboots. When done, go to pcc services section and make sure iptable service is set to run at boot time.

Do the above and things should just work even after a reboot.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline phantom16

  • Full Member
  • ***
  • Posts: 75
Re: possible to rebroadcast wifi for my nintendo DS?
« Reply #14 on: January 24, 2012, 08:19:17 PM »
done and done!
looks like it's all good now  ;D
thank you so much for your help!  :D