Click to See Complete Forum and Search --> : Special routes


acid45
06-26-2006, 03:01 PM
Hello all,

I'm trying to get a SMB share, and a few other services, going for my network. Here is a layout of my network:

legend
ath0 wireless atheros
eth0 ehternet
|
w = wireless connection
|

|
p = physical connection / ethernet
|


|_ISP_PUB_ADDR_______R_O_U_T_E_R_______192_168_0_1 _________|
| | | |
p p w w
| | | |
xbox1 windows1(XP) linux1 windows2(98SE)
| |
p p
| |
linux2 xbox2

both linux systems are slack 10.2 kernel 2.4.31 linux1 is up to date with swaret linux2 is up to date a few months ago with swaret
linux1 = ath0 192.168.0.110
eth0 192.168.0.250
linux2 = 192.168.0.111

insignificant
xbox1 = 192.168.0.3
xbox2 = 192.168.0.51
windows1 = 192.168.0.100
windows2 = 192.168.0.50

The problem is I can't figure out what route I need to get linux 2 from able to provide two things
1) local network service such as smb
2) provide wan service such as http, smtp, ssh, ftp, etc.

I would like to have all of the services running from windows1(smb only) and linux2. The problem is the only tutorial I found says I should set up IP_MASQ on linux1 on eth0 and then just set up linux2 with linux1->eth0->ip as the gateway and then make a host route back to linux2 from linux1.

This is what I tried this on linux2
ifconfig eth0 192.168.0.111
#the ifconfig command would create the route to network 192.168.0.0 through eth0 by default.
route add defaul gw 192.168.0.250

and this on linux1
route add -host 192.168.0.111 dev eth0
I also have a basic firewall that isn't firewalling anything, so it says, other than enablng IP_MASQ, the script is unmodified except it had eth0(outside changed to ath0) and eth1(inside, changed to eth0)

What am I doing wrong? Do I even have a clue? I can't find any example or anything other than the tutorial that looks remotly like what I'm trying. Then agani in the other tutorial, the eth0 was a public address and not a private address of the same network. Could this be causing problems?

Before I moved I did have this working one way, I was able to ssh from linux2 to linux1, or vice versa. I'm also pretty sure that when I did get it working, I had to reboot, not restart indetd, to flush the routing tables so I could access anything out of my ath0.

Any input and help and direction where I can find the information I'm looking for. What I might need to do. The name of what type of setup I'm trying to configure. Anything, would be greatly appreciated.

Here is the IP_MASQ tutorial I used, I do believe the routing tutorial I used was link to from this one.

http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html

m3rlin
06-26-2006, 10:09 PM
not sure that i figured it out but i will try to give you a hand.

Check your linux2 box for firewall, make sure it's not blocking the smb services, then open the other services that you need such http, smtp, ssh, ftp, etc.
After all of this services are lisening and the firewall ports open, you must configure your route to redirect all the packets to the linux2.

For a better understanding, i will try to explain on practice.

Internet http Request ----> Router accepts and redirects to Linux2 box ---> Linux2 http service lisening, accepts and reply. Your gateway on linux2 must be the routers IP.
Hope i helped

acid45
06-27-2006, 01:49 PM
Okay, before I go muddleing in things today, well I probably will try anyway, I'll just clarify a few things for if I fail.

On linux1 I don't want each interface to have an ip, only the one with a gateway set to the router? So the ethernet card won't have an ip on linux1 but the atheros card will.
linux1 should be able to get away with

ifconfig ath0 192.168.0.110
route add default gw 192.168.0.1 dev ath0
iwconfig ath0 essid channel key etc.
ifconfig eth0 up


On lnux2 I should be able to set it up as a normal system. I may just remove the firewall script.

ifconfig eth0 192.168.0.111
route add default gw 192.168.0.1


Since the router should be able to take care of the routing between linux1 and linux2 I shouldn't need any special static -host routes between linux1 and linux2. That's what the iptables are for, they will forward it and when the router responds it will send it back to linux1 whihc will forward it to linux2, if my iptables are set properly. I think I still need to tell linux1 what device to contact linux2 thourhg

Thanks M3rlin

edit
I think I may have found something that will get me going. The script was set for /usr/local/sbin/iptables, which I never noticed because the script uses echo too much to the point that I never noticed any errors after it started loading rc.inet2. I use /usr/sbin/iptables, well slackware does.