# Yet another newb trying to set up a router

## backtrace

I have two machines of wich only one (Gentoo) is connected to the internet through a wireless access-point, and I want my other box (Slackware) to use the connected one as a router. So far I've set up the network interfaces, ip-address and all, but I got stuck at trying to get the two machines to locate eachother.

The problem is that the boxes just don't seem to be on the same network, even though physically they are connected, and the routes and addresses seem to be set correctly.

My configuration in a more schematic way:

```
{internet} - {wireless access point} - [<wlan0(*.*.1.125)> box1 <eth0(*.*.1.111)>] - [<eth0(*.*.1.222)> box2]
```

Now I'm trying to get 'box2' to access internet through 'box1'. After two days of reading, trying, more reading and trying, etc. I think I could use some help with this.

----------

## GoofballJM1

Actually, the starred out (ie: *.*.1.222) is the information that would be most useful.  What is your LAN ip network?  10.0.x.x/24 or 192.168.x.x/24?

Which interface is your WAN interface and which is your LAN interface?

----------

## htranou

from what I can see, you seem to want to have both wlan0 and eth0 on the same subnet. If that's the case, bridging is what you'd like to do.

----------

## backtrace

Some more details of my network configuration:

-My workstation has an ethernet interface (eth0), for wich I set IP-address 192.168.1.222

-My router has both a wireless network interface (wlan0) with IP-address 192.168.1.125, and an ethernet interface (eth0) for wich I set IP-address 192.168.1.111

-The wireless interface is connected to a router with IP-address 192.168.1.1 through wich it connects to internet

Now the main problem is that I cannot get both my ethernet interfaces to reach eachother. But once I have that configuration working I want to be able to get my workstation (the one with only an ethernet interface) to get to internet as well as making available some services that run on the workstation accessible from internet.

----------

## htranou

here http://gentoo-wiki.com/HOWTO_setup_a_gentoo_bridge

Basically, you'll create a virtual interface that will put together eth0 and wlan0. Traffic from one will be routed through the other one.

The other solution would be to configure some NAT on your computer, but they will end on different subnets, which you may not want.

edit: if you look at the bottom of the page, it seems bridging can be hard to accomplish with wireless. It mostly depends on your drivers.

You can try some ARP proxy. I've read it worked, but I can't help you with that one.

----------

## backtrace

Thank you, htranou, the article looks useful. I will give it a go later today.

About the different subnets: As long as I can get both my boxes to reach the net, the one in the back through the one with the wireless interface, I'm happy.

----------

## Xamien

bumping

I've got exactly the same physical setup but anything more than basic networking and I'm out of my league.  Can someone run me through this in a basic form or point the way to a doc that covers it all?

----------

## Diesel_Fuel

You should install Shorewall (an "interface" to iptables).  Then try reading about this tutorial written for Debian (I realize you're not on debian, but the Shorewall stuff should help you out.). http://www.cyberdogtech.com/firewalls/tutorial.php?page=fw I run Debian on my server, and I used this to guide me and it works great.  I have a similar setup to yours, but its a bit more complicated:

(~~Internet~~) >> Cable Modem >> (eth1:  dhcp,10/100) >> (INSERT DELL POWEREDGE HERE   :Smile:  ) | (eth0:  192.168.0.1, gigabit, 255.255.255.0) | & | (eth2:  192.168.2.1, 10/100, 255.255.255.0) |

So this is how I bridge the stuff:  eth0 is bridged to eth1, eth2 is bridged to eth1, and eth0 is bridged to eth2 so they can communicate internally.  Notice that they are both on the same subnet, but each interface has a different IP address.  Good luck  :Smile: 

----------

