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.
How would i set two boxes static IP addresses instead of using DHCP (with DHCP already installed)? I've tried looking in the internet for something but havent found what i needed, and since the linuxquestions.org search is down i have no choice but to post. thanks
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393
Rep:
in /etc/network there are several config file. In one of the config files there should be a line that says DHCP NONE NONE NONE, or something similar. Look in the man pages and it should tell you what to change it to.
I'm very sorry for the vague response. I don't have a debian box at the moment and i'm relying on memory.
That doesnt work, but i suppose that's because i have my router set with DHCP active. Or is static IP address compatible with DHCP? Dunno i have my DHCP IP lease time set to Forever, but that doesnt really seem to do anything. If i deactivate DHCP on my router would the computers automatically get assigned a static IP or would i have to manually edit them all?
I really have no clue about networking...
u need to do one thing
either set ur systems for static ip adress or dynamic(DHCP) ones
u can change the configuration while the system is running and do
service network restart
that will take in effect the new settings
if ur systems do not get a dhcp adress from ur router then ur NIC will not start
u can edit that later and do the
service network restart
If your router has DHCP enabled, it is not garuntee that all computers (or routers) on the network will get a DHCP assigned IP.
If you wish to have a statically, DHCP does not need to be turned off or anything.
When you run dhclient it send a request to the DHCP server for a IP address. If no DHCP server is present it will fail.
Simply issue a "ifconfig eth0 netmask 192.168.0.1" subsituting the IP address for a static IP, however, you will need to do that each time you start up.
I don't know about config files and all that.
What cryptwizard suggested was right but u will have to do it everytime u reboot ur system , so its better to either wirite this command in rc.local or otherwise u can configure a DHCp server on ur machine which assigns a static ip to ur machine everytime u boot. For this reason u have to look at the man page of dhcp or search the net for dhcp configuration. I hope it wil help.
thnx
just check writing ifconfig whether ur network card is installed or not.
Hey tell me one thing u have two boxes then u will use eth0 for both the boxes not eth1
On the other hand if u have two ethernet cards installed on one system try using
ifconfig eth0:1 ipaddress netmask
thnx
The setup is i have two computers, one which has no mouse, keyboard or screen, so i have to connect to it with SSH. On boot up i want to automatically mount some folders using NFS, but it wont do that if everytime i boot them up i get diferent IP address's so i have to manually mount them. I want to be able to mount the files automaticallly. My main box (with screen, keyboard and mouse) has an onboard ethernet controller and an add-on card. The onboard is the nForce2 chipset that i usually have to manually install so i added an S82557 card which always works. After that i have set up my nForce2 chipset, but since i dont use it, i am using my eth1 which is the card. All i want to do is have these two debian boxes get static IP address's and all the other computers which log on to use DHCP. Thanks
this if config belongs to ur machine without mouse, keyboard or with mouse keyboard etc.
the best way to setup static ip on ur terminal(without mouse keyborad) is to write ifconfig eth0 ipaddress in rc.local and u dont have to give ip everytime.
This ifconfig is my main rigs. My second will probably have the same thing but with eth0 instead of eth1, cuz its motherboard got no onboard eth, so its running with the same card my main has. Gonna see if i can get it fooling around with some files.
1st, if you have debian boxes, is not rc.local (it won't exist!) but some link at /etc/rcS.d to a file in /etc/init.d. You should know that, but just in case...
2nd...
Quote:
On boot up i want to automatically mount some folders using NFS, but it wont do that if everytime i boot them up i get diferent IP address's so i have to manually mount them.
I had the same question and solved the way you tring to do... but then return to dhcp, wich work fine, by doing the exports (/etc/export) not a single (static) IP, but a range like 195.245.0.* (or 195.245.0.0), whatever your DHCP gives. No matter wich IP the cards gets as long as they belong to the range you wrote... everything should be exported nice and mountable at computers on your network. if you add another computer you don't need to add another IP to your configuration files, just a mount of the NFS export. Your Internet connection can continue with dhcp, and you don't have to think about IPs anymore
(I think something like 195.245.0.1/10, e.g., should work too, exporting for all ips from termination 1 to 10; and of course using the IP ranges that your dhcp server assign to your lans)
hope this give you some help.
Edit: oh... and you could use the name (or domains) of computers, instead of IPs at exports file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.