LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-31-2003, 06:11 PM   #1
lunchin
LQ Newbie
 
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3

Rep: Reputation: 0
networking issues


I just recently downloaded redhat 8.0 as a first time user to linux. I built a new system(win 2000) and put redhat on my old one. I am having issues getting my linux box functional. My setup is such that I have my linux box connected to a router/switch that is hooked up to a cable modem. The router hosts other computers in the house so I can not hook up the linux box directly to the cable modem. From the router I have the linux box which has two nic cards, with my new machine linked to the other nic. I am having trouble configuring the network. On eth0 I set up dchp server. On eth1 I gave a internal static ip address and gave network addresses and gateways to the router. Can someone which way is easiest to configure the network. I have looked around and tried many solutions from forums and tutorials to no avail. Which scripts have the most pwoer in terms of functionality. Ant suggestions would greatly appreciated.
 
Old 01-31-2003, 06:39 PM   #2
Loke
LQ Newbie
 
Registered: Oct 2002
Location: Norway
Distribution: Suse 8.0
Posts: 21

Rep: Reputation: 15
Do you want to use your Linux box as a choke firewall, since you have given it two nics and connected it to you other PC? If so, then you must make sure that you have turned on IP-forwarding; in the file /etc/sysctl.conf there should be a line
net.ipv4.ip_forward = 1
If it is set to 0, change it to 1.

In case your Linux box is just another workstation then booth PCs should be connected directly to your hub/switch and you only need one nic per PC. If you router has only one J45 connector get a hub (or switch); which doesn't cost much these days.
Here is an example config file for static IPs

/etc/sysconfig/network-scripts/ifcfg-eth0 # Ethernet card 0
DEVICE=eth0
BOOTPROTO=static # Change for DHCP
BROADCAST=10.0.0.255 # Change as appropriate
IPADDR=10.0.0.2 # Change as appropriate
NETWORK=10.0.0.0 # Change as appropriate
GATEWAY=10.0.0.1 # Change as appropriate
ONBOOT=yes

Idem for eth1 if you are using two nics.
 
Old 01-31-2003, 07:32 PM   #3
lunchin
LQ Newbie
 
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
My router has three other machines hooked up to it right now, so I only have one available connection which is why I gave the linox box 2 nic cards. Should I assign eth0 as static or dhcp, since my router is dhcp and automatically assigns ips. The router does see the linux box as well when i look at it from another machine in the house. Right now I just want to be able to have my two machines be visible on the network and have internet access. I have tried both static and dhcp for eth0 and cannot ping from either setup. I have also tried using a hub from the router to connect the two machines, but the router does not recognize the hub. Any suggestions?

Last edited by lunchin; 01-31-2003 at 07:34 PM.
 
Old 02-01-2003, 02:05 AM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I'll take a stab at it...

I'm afraid all I can offer is some basic cabling advice.

First, the router should not care about the hub. It should never recognize it (i.e. you should never see an entry for any hub in any router table). However, you need to connect your hub's uplink port to a regular port on your router. If the two computers are set up for DHCP, plugged into the hub, and the hub plugged into the router, then you should be ok.

If the hub doesn't work for whatever reason. Make sure you have a crossover cable connecting the two machines. If you don't have a crossover, then you can use the hub instead; connect one NIC in the Linux box to the router, then plug the other NIC into the hub, and finally, connect the other machine to the hub as well. At this point, you'll have to set up the dhcp client for the interface connected to the router. Once you do that, the you can go through the hassle of setting up the other interface as a DHCP server, or simply give it (and the other computer) a static IP.

Unless this is a learning exercise, the first option is the best choice. Work to get the hub working with the router.
 
Old 02-01-2003, 02:48 AM   #5
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
Yea what he said.

To connect the hub to your router use either:
-a regular cable from the hub to the router's uplink port
-a regular cable from the hub's uplink port to the router
-a crossover cable from the hub to the router

As long as you get link lights when you plug the hub into the router you should be able to add computers to the hub and they will "see" the router.
 
Old 02-01-2003, 10:48 AM   #6
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Quote:
On eth0 I set up dchp server.
I really hope you meant "dhcp client". You need to collect a dhcp lease from the router, not give one.

This is the first part to get working ok.
No connection to the router, and you get nowhere...

In the Network tool, change the boot parameters to be dhcp and "activate" the interface. Then view it's configuration.
 
Old 02-01-2003, 06:23 PM   #7
lunchin
LQ Newbie
 
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
I can now get my linux box online from the router to eth0. Before I had it setup as dhcp but i had wrote a script and placed it in the rc.d/init.d directory which was overwrting the settings on boot. Now I am having trouble getting the second machine online though eth1. Do I have to use ip masquerading in order for it to work. Also, should my windows box have the same ip as the eth1. Do i need a special routing script? Any help would be great.
 
Old 02-01-2003, 06:27 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes you want ip masquarading. i normally recommend just using a firewall program like firestarter which will give you a safe firewall as well as ip masqing
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Networking issues biased99 Linux - Networking 4 02-09-2005 03:36 AM
RH 7.3 Networking Issues sussen Linux - Networking 2 11-15-2004 08:41 AM
Linux Networking Issues compassman Linux - Networking 4 04-23-2004 10:58 AM
Networking Issues. StrongKungFu Debian 2 04-10-2004 12:52 PM
Networking Issues TerryRJ Linux - Newbie 1 03-04-2003 05:20 PM

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

All times are GMT -5. The time now is 01:45 AM.

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