Click to See Complete Forum and Search --> : RedHat 7.3 as firewall/gateway


NegativeZERO
11-25-2002, 04:08 AM
What I'm tryng to do is set up my RH 7.3 box as a gateway/firewall server for the rest of my lan. After I get all of this configured I'm going to set up a httpd and ftpd services as well.

The problem I'm having is I cant ping any thing out side of my lan. I can ping my internal router/hub and all the boxes on my network. One XP machine, one Win2k Machine, and a RedHat 8.0 desktop. I can ping every single box in my network and they can ping and get a reply back just fine from the gateway/firewall box I'm setting up.

I have eth0 set for my internal network, and eth1 for the external connection to my aDSL.

I have set up IPChains as the firewall, and have enabled IPMasquing by folowing the NHF at this site as well as reading a firewall howto. But I still cant get the firewall/gateway to talk to the out side world.

Here is how I have the RH 7.3 box set up in the networking files.



/etc/sysconfig/network
NETWORKING=yes
GATEWAYDEV=""
HOSTNAME=ns-network.uni.ccr
GATEWAY="209.152.79.x"

/etc/sysconfig/network-scripts/eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
ONBOOT=yes

/etc/sysconfig/network-scripts/eth1
BROADCAST=192.168.0.255
DEVICE=eth1
NETMASK=255.255.255.0
IPADDR=209.152.79.xxx
NETWORK=209.152.79.0
ONBOOT=yes
BOOTPROTO=none

I get this when I do a route -n as root

rout -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
209.152.79.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo



The howto I was reading had one other entry in the route table, it had a default part in it. Here is a copy of the route table in the firewall howto I was working from.

#route -n
Kernel routing table
Destination Gateway Genmask Flags MSS Window Use Iface
24.94.1.0 * 255.255.255.0 U 1500 0 15 eth0
192.168.1.0 * 255.255.255.0 U 1500 0 0 eth1
127.0.0.0 * 255.0.0.0 U 3584 0 2 lo
default 24.94.1.123 * UG 1500 0 72 eth0


The part I'm missing is the default section out of the routing table. Does this default section tell where the main gateway is for the box I'm trying to set up, or is this no big deal for me at all. Also do I need to set the gateway of my internal NIC eth0 to the IP of my external NIC so it knows where to look and send my internal request to the out side world? I would think this would only hinder the internal traffic not knowing where to go to get out of my lan. But even using the gateway/firewall box I'm setting up after setting it like that I cant ping any thing out of my lan, or any thing inside of it at all.


I sure hope some one can help me figure out what my problem is. If you need any more info let me know.


Thanks for the help!
NegativeZERO

mychl
11-25-2002, 11:57 AM
you can use the route command to add your gateway.

route add default xx.xxx.xxx.xx

NegativeZERO
11-25-2002, 06:08 PM
I'm just going to say forget it. After even setting the default route I still cant ping any thing out side of my lan. I have a hub running the rest of the connectios in my lan, I'm just going to get a linksys router/hub or some thing insted of messing with this.

I wonder if the nic I have to configure manualy is what is giving me the problems? I have to manuly configure my nic that is pointing to the outside world. I guess I should bring down eth0 and then see if I can ping out side of my lan.

If any one has a helping idea thanks!


Later
NegativeZERO

Wibble
11-25-2002, 06:14 PM
I have a setup similar to yours. Cable modem connected to eth0. eth1 connected to a hub. 2 Win PC's connected to the same hub. They use the RH 7.3 box as a router/firewall. However, I cheated. I didn't use IPTables properly, I d/loaded and installed Firestarter, which has a GUI frontend. That worked straight out of the box. The plan was (and still is) to use that as a quick start to getting on the net, then try and learn IPTables properly later on.

Give it a whirl.

NegativeZERO
11-25-2002, 06:44 PM
I dont have x installed on my server. It will use to many resources and space for the machine I'm running it on.

PII 550Mhz
8.4GB HDD
10 GB HDD
448MB PC133 SDR

The specs are plenty good for running a deacent server, but I do nt want to install x on it. Thanks for the idea though.


Later
NegativeZERO