Page 1 of 2

networking things

Posted: Thu Jul 20, 2006 12:03 pm
by shiznatix
ok i have a wireless card and a ethernet card on my desktop computer. i have a wireless router in my friends place across the hall and thats how i get internet. my wireless card on my lap just is not working and i give up.

ok so the desktop wireless works. i have another wired router in my room and i have been trying to connect the desktop ethernet card to the wired router then my laptop to the wired router. when i do that after about 2 minutes the internet dies on the desktop comp but i can ssh from my laptop to my desktop. if i unplug the desktop ethernet the internet works again in like 2 minutes.

how do i get this so my laptop can get internet!!!

ps. using the latest version of ubuntu.

Posted: Thu Jul 20, 2006 2:39 pm
by Chris Corbyn
Why isn't the wireless card working on the laptop? Could it be something as stupid as eth0 and wlan0 both being up, but only wlan0 is connected and Ubuntu is trying to route traffic through eth0?

Sounds like your router might be faulty if it bails when two machines connect to it... that is weird.

Perhaps I've misunderstood but is this how things are set up?

Code: Select all

Desktop Ethernet
                                               ^
                                                |
    [ Internet ] <----->  [ Wired Router ]  <------> [ Wireless Router Across Hall ]
                                                |                                                 |
                                               \/                                                 |
                                        Laptop Ethernet                                \/
                                                                             Friend's Wireless Computer

Posted: Thu Jul 20, 2006 2:48 pm
by kbrown3074
I have heard quite a few ppl having problems with Dapper. Check out http://www.ubuntuforums.org They have a good number of ppl with the same problem.

Posted: Fri Jul 21, 2006 3:00 am
by shiznatix
d11wtq, here is how its setup and i have no idea why the wireless card won't work. no native linux drivers and all that happy jazz. i plugged in my wireless card to my desktop comp and it worked right away. it might by my laptops problem too as the thing is really messed up.

Code: Select all

[internet]<----->[wireless router across hall]<---(wireless connection)--->[desktop computer]
                                                                                   ^
                                                                                   |
                                                                          (wired connection)
                                                                                   |
                                                                                   \/
                                                                             [wired router]<----->[laptop]
kbrown3074 i posted there yesterday but there where no responces before i went to bed.

Posted: Fri Jul 21, 2006 5:22 am
by Chris Corbyn
Ok that diagram clears things up thanks :)

I think your problem could be that your default gateway is changing to use the wired connection when you plug the desktop computer into the wired router. Easy to check.

Code: Select all

#with the wired router plugged into desktop
route -n
<remember this result>

#plugin the wired router and wait a few mins for DHCP to work
route -n
<compare against correct result>
That would then mean your computer is trying to get via the wired router to get internet, which clearly wont work.

What you should do, is turn off DHCP on the wired router, assign both the laptop and the desktop a static IP, then you want to enable connection forwarding (NAT) on the desktop PC which has the internet connection. The laptop can get it's internet access via the desktop.

Posted: Fri Jul 21, 2006 6:42 am
by shiznatix
d11wtq wrote:What you should do, is turn off DHCP on the wired router, assign both the laptop and the desktop a static IP, then you want to enable connection forwarding (NAT) on the desktop PC which has the internet connection. The laptop can get it's internet access via the desktop.
then the circle of life is complete. thanks for that advice ill let you know how things turn out when i make it home.

Posted: Fri Jul 21, 2006 6:57 am
by Chris Corbyn
shiznatix wrote:
d11wtq wrote:What you should do, is turn off DHCP on the wired router, assign both the laptop and the desktop a static IP, then you want to enable connection forwarding (NAT) on the desktop PC which has the internet connection. The laptop can get it's internet access via the desktop.
then the circle of life is complete. thanks for that advice ill let you know how things turn out when i make it home.
You might need a hand with the NAT stuff so get the computers connected to the router with static IPs first and make sure internet still works on the desktop, then we can sort the NAT out next.

Posted: Fri Jul 21, 2006 11:16 am
by shiznatix
affirmative, both computers have an ip on the wired router and can ssh to eachother while i am still on the internet on my desktop computer. how do i start with nat?

Posted: Fri Jul 21, 2006 12:30 pm
by Chris Corbyn
shiznatix wrote:affirmative, both computers have an ip on the wired router and can ssh to eachother while i am still on the internet on my desktop computer. how do i start with nat?
OK, it's quite simple really (if you blindly do as told :P).

I'm assuming the desktop is running Linux yes?

Install "iptables" on the desktop with the internet connection. Then allow IPv4 forwarding. Then create the NAT rule to give your laptop access....

Code: Select all

#use package manager to install iptables -- you can do this yourself i'm sure ;)

#allow forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

#create the rule (assuming wlan0 has the internet access)
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
OK, now the desktop is set up as a router (sort of).

Now you need to configure your laptop to make use of that:

(I'm assuming you run linux on the laptop too.... It's easy enough to translate to windows if not).

Firstly, create the default route as your desktop IP:

Code: Select all

#create a new route (he your desktop IP would be 192.168.1.2)
route add default gw 192.168.1.2

#set up name resolution (this is a bit of a dirty hack)
scp 192.168.1.2:/etc/resolv.conf /etc/resolv.conf

#see if it works
ping www.google.com

Posted: Sat Jul 22, 2006 9:02 am
by shiznatix
ok the wireless on the desktop is called ra0 and the desktop things worked without errors.

the desktops wired ip is 192.168.0.3 and when i do the 'route add default...' it says 'SIOCADDRT: File exists' but the copy thing works. when i try to ping google it has googles ip and everything but does not work.

Posted: Sat Jul 22, 2006 9:29 am
by Chris Corbyn
shiznatix wrote:ok the wireless on the desktop is called ra0 and the desktop things worked without errors.

the desktops wired ip is 192.168.0.3 and when i do the 'route add default...' it says 'SIOCADDRT: File exists' but the copy thing works. when i try to ping google it has googles ip and everything but does not work.
You do the "route add default gw ...." on the laptop, not on the desktop. You put your desktop's IP in there, so that the laptop, uses the desktop as it's gateway to the internet.

If it's still saying it already has one, do a "route del default gw <ip here>" -- it will be the last IP in `route -n':

Code: Select all

root @w3style ~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0

root @w3style ~# route del default gw 192.168.1.254

root @w3style ~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0

root @w3style ~# route add default gw 192.168.1.254

root @w3style ~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0

root @w3style ~#
BTW, rebooting the dekstop will reset that iptables rule and the ipv4 forwarding, so you need to do that at boot time.

Posted: Sat Jul 22, 2006 10:40 am
by shiznatix
ya i was doing the route add host stuff on my laptop sorry for the confusion.

the ips for everything are in this list:

desktop wireless: ra0 192.168.2.100
desktop wired: eth0 192.168.0.3
wired router: 192.168.0.1
laptop wired: eth0 192.168.0.2

(on my laptop:) there where 2 extra rules when i checked 'route -n' one was with the routers ip and the othe for the desktops ip. i deleted both and added the desktops again. now when i try to ping google it says:

PING http://www.l.google.com (64.233.189.104) 56(84) bytes of data.
*then it waits like 5 seconds*
From 192.168.0.3: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.1)

route -n produces:

Code: Select all

192.168.0.0    0.0.0.0           255.255.255.0    U       0    0    0    eth0
0.0.0.0        192.168.0.3       0.0.0.0          UG      0    0    0    eth0
everything done on the laptop.

Posted: Mon Jul 24, 2006 8:06 am
by shiznatix
still not working, *bump*

Posted: Mon Jul 24, 2006 8:08 am
by Benjamin
Maybe it's a firewall issue?

Posted: Mon Jul 24, 2006 5:21 pm
by shiznatix
astions wrote:Maybe it's a firewall issue?
negative, i don't have any firewalls running (don't slay me).