Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-31-2003, 06:11 PM
|
#1
|
LQ Newbie
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3
Rep:
|
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.
|
|
|
01-31-2003, 06:39 PM
|
#2
|
LQ Newbie
Registered: Oct 2002
Location: Norway
Distribution: Suse 8.0
Posts: 21
Rep:
|
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.
|
|
|
01-31-2003, 07:32 PM
|
#3
|
LQ Newbie
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
02-01-2003, 02:05 AM
|
#4
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
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.
|
|
|
02-01-2003, 02:48 AM
|
#5
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
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.
|
|
|
02-01-2003, 10:48 AM
|
#6
|
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458
Rep:
|
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.
|
|
|
02-01-2003, 06:23 PM
|
#7
|
LQ Newbie
Registered: Jan 2003
Location: Washington, DC
Distribution: Redhat 8.0
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
02-01-2003, 06:27 PM
|
#8
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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
|
|
|
All times are GMT -5. The time now is 01:45 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|