routing

Discuss Networking
Post Reply
Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

routing

Post by Master of Reality » Sat Nov 26, 2005 1:36 pm

So ive been playing around for quite some time trying to figure this out.
I have a thinkpad with no wireless that is cable connected to my laptop which has a wireless connection to my router (192.168.0.1) to get to the internet.

What routes would i setup to have my laptop enable the thinkpad to connect to the internet?

So far the only thing i managed to get is a ping between the laptops. I set their LAN interfaces to 10.10.0.1 and 10.10.0.2 addresses and the wireless interface is 192.168.0.4.

I couldnt seem to get anything working making them all the 192.168.0.* (the wireless laptop would get confused trying to find the default gateway 192.168.0.1)

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Sat Nov 26, 2005 5:08 pm

What OS is on the Laptop? Either way you will have to have at least 2 ethernet interfaces on the laptop (which I assume you do) such as one wireless and one wired. You will need to bridge these interfaces if you are running Windows XP for this to work.

The IP scheme you have setup seems flawed. Only a routing device can route between subnets which your laptop is not. Try this:

Wireless gateway IP: 192.168.0.1
Wireless laptop interface IP: 192.168.0.2 w/gateway of 192.168.0.1
Wired laptop interface IP: 192.168.0.3 w/gateway of 192.168.0.2 or 192.168.0.1 (either should work)
Thinkpad interface IP: 192.168.0.4 w/gateway of 192.168.0.3

All should have a 24 bit subnet mask (255.255.255.0).

All of this is going to hinge on your laptops ability to bridge between these two interfaces. Hope this points you in the right direction.

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Sat Nov 26, 2005 7:28 pm

im using linux on both. What would the route command look like to make the wired eth1 to use the wireless eth0 as the gateway.
would it be like...
# route add default gw 192.168.0.2 eth1
:?:
assuming wireless eth0 is 192.168.0.2, like your example, etc.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Sat Nov 26, 2005 7:45 pm

I believe that would work. I always just assign a default gw to all interfaces by "route add default gw xxx.xxx.xxx.xxx". You may be able to have both interfaces be the same gw. I would try that first and if it does not work try and assign eth0 as eth1's gateway.

However using the route binary to add a gateway is not persistant and will be removed if the system is rebooted. If you are using RedHat then you can edit /etc/sysconfig/network-scripts/ifcfg-eth1 and make the configuration more permanent.

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 » Fri Dec 02, 2005 3:13 am

Bridgeing interfaces is an easy way to do it, I had heaps of trouble getting something very similar working a while back. Bridging on Linux is pretty simple, however I havn't done it in bloody ages. brctl or something is the tool for it. There is a howto on tldp I believe.

Post Reply