LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Redhat 8.0 as a Router (https://www.linuxquestions.org/questions/linux-networking-3/redhat-8-0-as-a-router-36215/)

falconxlc 11-22-2002 09:31 PM

Redhat 8.0 as a Router
 
Before you begin to assess my problem, I would like to thank you for taking the time to read my concern.

My computer has:

amd 750
tnt2 m64
15 gig hd
2 ethernet cards
Cable modem connection to the internet

I would like to setup this computer as a Linux RH Box so other computers can use the internet through this computer.


SETTING UP DHCP
---------------

So far i have install everything on the 3 redhat8.0 cds.
The two network cards were installed fine and one of them(eth0) is connected to the cable modem. The other one has manually assigned ip, subnetmask, and def gateway. so basically:

eth0 - ip/subnetmask all assigned from ISP
eth1 - ip=192.168.0.1
submask= 255.255.255.0
gateway= 192.168.0.1

I followed steps on the mini dhcp server setup
http://www.tldp.org/HOWTO/mini/DHCP/x369.html

I have setup dhcp on eth1 and my dhcp.conf looks like this:

/etc/dhcp.conf
-------------------------------------------------
# Sample /etc/dhcpd.conf
# (add your comments here)
ddns-update-style interim;
default-lease-time 720;
max-lease-time 86400;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;

#router is the ip add of my eth1?
option routers 192.168.0.1;

#doman names of my isp - gotten from /etc/resolv.conf
option domain-name-servers 167.206.3.143, 167.206.112.138, 167.206.7.4;
#option domain-name-servers 192.168.0.1;
option domain-name "falconxlc.org";

#assign internal networks ips ranging from 192.168.0.10-254
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.100;
range 192.168.0.150 192.168.0.200;
}
------------------------------------------------------

My other computer is running windows 98 and when it boots up it receives an assigned ip address based on this script.


ROUTING
-------

Ok, so now...ideally i would like to have every computer that is connected to this dhcp server to be able to access the internet, so i tried to setup Linux IP Masquerade by following instructions at:

http://ipmasq.cjb.net/

i have a firewall ruleset running using iptables

and following that my /sbin/route -n output looks like:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
xx.xxx.128.0 0.0.0.0 255.255.248.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 xx.xxx.128.1 0.0.0.0 UG 0 0 0 eth0

(my real ip is hidden under the x)


ok well, now everything shoudl work but it doesnt....and my questions are:

1) should I have manually setup my ip address for my ethernet card(eth1) which is the dhcp server? if so, what should the gateway be set to?

2) In my dhcp.conf file, the options route should point to the ip address of eth1 (192.168.0.1). if not, what should it point to?

3) How to set it up so that my win98 computer can connect to the internet? It doesn't work as of now. Though, it can ping my eth1 computer.

If you want me to show you any file or output of a command please post it and i will let you know.

Thanks

falconxlc 11-23-2002 12:46 AM

found solution here:

http://docs.myjabber.net/howto/ip-Tables.htm


my iptables were setup wrong...but dhcp was ok

Ciccio 11-23-2002 12:03 PM

#Enable Forwarding in kernel
echo 1 >/proc/sys/net/ipv4/ip_forward

#Disable IP spoofing attacks
echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter

#Don't respond to broadcast pings (Smurf Amplifier Protection)
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

#Block source routing
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route

#Kill timestamps
echo 0 > /proc/sys/net/ipv4/tcp_timestamps

#Enable SYN cookies
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

#Kill Redirects
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects

#Enable bad error message protection
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses

#Log martians (packets with impossible addresses)
echo 1 > /proc/sys/net/ipv4/conf/all/log_martians

#Reduce DoS'ing ability by reducing timeouts
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 2400 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 0 > /proc/sys/net/ipv4/tcp_windows_scaling
echo 0 > /proc/sys/net/ipv4/tcp_sack

add those to /etc/rc.d/rc.local and restart (network) then you should be able to do it.


All times are GMT -5. The time now is 08:19 AM.