Linux - NetworkingThis 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.
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.
Hi, im a bit of a newbie when it comes to networks...
BUT, i have got my LAN working 100%
my questions, are on the setting i need to enter to access the internet
through a cable modem connected to my eth0 network card.
my network card itself is working 100%, i can FTP and play network games with other pc's on the lan. my ip adress is 192.168.0.12
this is the pc that needs to connect ot the internet (subnet is 255.255.255.0)
my questions are.....
1) do i need to re-assign IP's so that My ip address is 192.168.0.1 ? to make the
cable modem wok with this machine ?
2) i know a gateway computer is an IP of a computer that the internet connection goes through..... since there is only 1 machine accesssing the internet, do i need to set this ?
if so, do i set it to 127.0.0.1 (loopback) 192.168.0.x(this machines's eth0 IP)
OR the broadband cable modems IP ????
3) does the cable modem have its own Ip ? if so, what is it ? do i need to set it as a gateway ?
Thankyou for any help...
ive the only advice other forums give me is to just insert the CD that NTL (my ISP) gave me, but thats a windows only disk (im on redhat linux 9)
1) Your cable modem is connected to eth0. How is the computer also connected to other pc's on your lan? Do you have a second interface (eth1) on the machine and a hub to connect to the other machines, or do you have just the one interface (eth0) which is connected to the cable modem via a hub or a router?
2) How did eth0 get the IP address 192.168.0.12? Did you assign it manually, or was it obtained automatically through some method?
3) What does your /etc/sysconfig/network-scripts/ifcfg-eth0 file look like?
I'll give you an answer assuming that the cable modem is directly connected to eth0 and you manually assigned the ip address to eth0. If this isn't the case, you should try it like this first, just to make sure it works properly. You can then let me know if you need a different answer
The easiest way to get this thing working is to set eth0 to use DHCP to get its IP address. DHCP is a good thing, because it will also set DNS servers and lots of other stuff that you really need to be able to connect to the Internet, but that you might not care to know about at this point.
To do this (you have redhat 9, right?):
Edit the file:
/etc/sysconfig/network-scripts/ifcfg-eth0
Make sure there is a line in there that says:
BOOTPROTO=dhcp
(you might want to back up the file or at least document your changes if you are not comfortable modifying the file)
and that you are NOT assigning it an IP address manually with a line like:
IPADDR=192.168.0.12
After you add that line, restart the interface like so:
/etc/sysconfig/network-scripts/ifup eth0
It should say something like:
Determining IP information for eth0... Ok
And you should be up and running...maybe. Isn't Linux fun?
DCPH always fails, but this may be due to me using the wrong netmask at first...
anyway, to answer your questions.... lol
i have 1 ethernet network card with connects to a switch,
the other PC's on the lan also connect to the switch, and so deos the Modem.
my adress is 192.168.0.12 because when i first installed my network card,
i was at a LAN party, i was the 12th person to arrive, so i was assigned that IP (entered manually with redhat-config-network)
i cant tell you what my /etc/sysconfig/network-scripts/ifcfg-eth0 looks like, im not home at the moment.
i tried to use DHCP, but it failed... could this be due to me forcing the .0.12 ip on the network card ??
plus i read that dhcp requred a DHCP server....
which i dont have installed... (or maybe the modem acts as a DHCP server ???)
but thanks for the help so far.
yeah, linux is great.... i just discovered i can set Quake2 as my Window's manager....makes logging in fun !!!!!
Your ISP most likely has a DHCP server on the other side of the cable modem. The problem is that the switch is too dumb to properly communicate with the DHCP server through the cable modem.
So...
The switch isn't going to be able to communicate properly with the modem and pass Internet traffic appropriately. The cable modem needs to be plugged directly into the network adapter on the pc or into a router (which is basically just a stripped down computer...some of them even run Linux).
Try this if you haven't already:
Unplug the cable modem and the pc from the switch and plug the cable modem directly into the pc. Try the dhcp thing and see if you can get that working.
Of course, now your pc is no longer connected to the lan. There are 2 ways to make the "right thing" happen for you, assuming you can get the pc to work with the modem.
1. Get a router and replace your switch with the router. The router will allow you to share the internet connection among all of your pcs.
2. Add a second network interface to your internet-connected pc. One interface will connect to the lan, and the other will connect to the cable modem and the Internet. You can even configure your pc to act as a gateway and route Internet traffic to the other pcs on the lan (but that's a whole other story).
Option 1 is probably simpler, but will probably cost you more money. Option 2 will cost you the price of a new network card and the time it takes you to get it up and running, which is a good thing to know how to do, and shouldn't be too complicated if you get a relatively popular card.
But the first thing to do is see if you can get your pc to work just with the cable modem, without the lan and the switch involved.
ok i will try that...
but origonally windowsXP was connected directly to the modem..
when i put a switch between the modem and windowsXP. it still worked fine.
what if i was to connect the modem directly up to the linux machine (no switch)
then connect to the internet (allowing dhcp to work) then went back to my current setup
with the dhcp info saved, so i dont need dchp to connect...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.