LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2003, 09:26 AM   #1
scobapro
LQ Newbie
 
Registered: Apr 2002
Location: Rexburg, ID
Distribution: Red Hat 7.2
Posts: 8

Rep: Reputation: 0
Home Network Routing Problem?


I'm not new to Linux, but this is the first time I have attempted to set up a Linux server. For some reason I cannot connect to the internet from within the network.

I have only two computers:

A) Red Hat 7.3 -- an old computer I am trying to set up as an apache/network server/router.

B) Red Hat 8.0/Windows XP -- this is my main computer, normally it is just connected directly to my cable modem.

How I have them set up:

Computer A has two ethernet cards....eth0 is connected to my cable modem, and is configured to use dhcp...eth1 is connected to my hub and has the ip addr 192.168.0.1, netmask 255.255.255.0. Also, I have enabled ip forwarding in /etc/sysctl.conf.

Computer B has one ethernet card...eht1 is connected also connected to the hub and has ip addr 192.168.0.2, netmask 255.255.255.0, gateway 192.168.0.1, nameserver(s) I got from my isp. I have been able to set it up this way in both windows and linux.

After disabling the firewall on the server, I have been able to ping and ssh between both computers....but I cannot access the internet from computer A. From everything I've read, my setup should be okay, but I cannot figure out why it's not working properly.

To anyone who can help me with this, I will be eternally thankfull.....

Thank you!
 
Old 01-03-2003, 09:28 AM   #2
scobapro
LQ Newbie
 
Registered: Apr 2002
Location: Rexburg, ID
Distribution: Red Hat 7.2
Posts: 8

Original Poster
Rep: Reputation: 0
forgot some stuff...

Oops...

I forgot to mention that the server connects to the internet just fine....I thougt I might have to clone the mac address from my normal computer, but this didn't matter, as my isp just assigned a new ip address when I conneted the server to my modem.

Thanks.
 
Old 01-03-2003, 10:15 AM   #3
dimanise
LQ Newbie
 
Registered: Jan 2003
Posts: 5

Rep: Reputation: 0
never done this myself, but i recall you need support for routing compiled into your kernel

just thought could be somewhat useful
 
Old 01-03-2003, 11:00 AM   #4
turnip
Member
 
Registered: Jul 2002
Posts: 143

Rep: Reputation: 15
Have you tried:

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

to setup iptables for Masquerading?
 
Old 01-03-2003, 11:13 AM   #5
scobapro
LQ Newbie
 
Registered: Apr 2002
Location: Rexburg, ID
Distribution: Red Hat 7.2
Posts: 8

Original Poster
Rep: Reputation: 0
SUCCESS!!!

Thank you so much for your help!

I had a feeling there it had something to do with my iptables...but I didn't know how to set it up to masquerade....works perfectly....

Thank you!
 
Old 01-03-2003, 11:49 AM   #6
turnip
Member
 
Registered: Jul 2002
Posts: 143

Rep: Reputation: 15
You're Welcome, you may want to look into some blocking rules, so you are not wide open to the internet.

something like

iptables -I INPUT -s 192.168.0.0/24 -j ACCEPT
iptables -P INPUT DROP

should get you started.
 
Old 01-03-2003, 12:43 PM   #7
scobapro
LQ Newbie
 
Registered: Apr 2002
Location: Rexburg, ID
Distribution: Red Hat 7.2
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks again.....I would ask you what these rules do, but maybe it's better if I just read up on them myself...in fact, I think I'll do that right now...

Thanks
 
Old 01-03-2003, 02:10 PM   #8
jrmann1999
Member
 
Registered: Feb 2001
Location: Texas
Distribution: Slackware, Mandrake, LFS
Posts: 306

Rep: Reputation: 30
To get you started, the first rule allows all traffic from the

192.168.0.0/24 range(192.168.0.1-255)

the second rule denys all traffic from everywhere else.

Both act on the input chain which in turn will inspect every packet the machine gets(with the exception of those dropped on prerouting). It would be in your best interest to choose an IP that's not in the 192.168.0.0/24 range tho, and instead chose something more like 192.168.5-240.0/24 range, .0.X is an overused and overspoofed IP.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname/Routing problems with home network robintw SUSE / openSUSE 15 01-08-2005 07:55 AM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 03:26 PM
Routing Problem with two network cards a.tangemann Linux - Networking 0 02-23-2004 04:07 AM
Redhat 7.3 and ADSL routing to home network, help required. Danners Linux - Networking 4 11-21-2002 04:18 PM
Network (probably routing) problem - please help briano Linux - Networking 4 06-27-2001 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration