LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Forcing to use a static ip address (https://www.linuxquestions.org/questions/linux-networking-3/forcing-to-use-a-static-ip-address-925890/)

gurl4sh25 01-26-2012 08:46 PM

Forcing to use a static ip address
 
Hi All, I have a Linux Machine, and I want to configure it to use this static ip address 192.168.2.1. For some reason it does not accept and link could not be up saying there's another host is running with this IP.

As I have limited access to the network, and I cannot unplug the network and configure the server, Is there anyway to configure it by force and disregard any ip conflicts?

I know that ip conflict is not good and would create issues, but main question is, is it possible? How do i do this?

frankbell 01-26-2012 09:01 PM

x.x.x.1 is by default the gateway address. It is likely the address of your router.

You could use x.x.x.2 to x.x.x.254. If this is a home router, I would check the DHCP settings of the router. Most of them reserve a block of addresses for static and are configured to assign DHCP above that block. For my router, DHCP starts with x.x.x.100 to above. (This is a configurable setting.)

If it's not a home router, check with the IS Dept.

gurl4sh25 01-26-2012 09:11 PM

Hi frankbell, thanks for the reply. I do know that I can use other ip on that subnet. What I'm trying to do is use one specific ip and force it to.

Knowing that I dont have any access on the network and physical access on that server. Right now what I have is iLO to the server itself. So was thinking if is it possible to configure it on the OS side, forcing an ip address. I've done research, something to do with the bad arp broadcast, was thinking to disable the arp on the server if possible but problem is i don't know how.

suicidaleggroll 01-27-2012 11:18 AM

I configure all of my servers with static IPs, never had a problem with any of them "rejecting" it because of a duplicate. They'll hold onto the IP even if the network cable is unplugged or the router is on a different subnet, they don't care.

This is how I do it:
1) Uninstall NetworkManager (it ALWAYS screws things up for me)
2) Find the ifcfg file for the device I'm interested in, usually in /etc/sysconfig/network-scripts/ifcfg-eth0
3) Modify the file to look something like this:
Code:

DEVICE=eth0
HWADDR=00:25:90:56:8E:5F
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
IPADDR=192.168.1.132
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
TYPE=Ethernet
DNS1=68.87.85.98
DNS2=68.87.69.146
IPV6INIT=no
USERCTL=no
PREFIX=24

Swapping out DEVICE with your device name, HWADDR with your MAC, IPADDR, GATEWAY, NETMASK, and NETWORK to match your setup, and DNS1/2 to match your DNS servers. The above file is from a Fedora 16 system, other distros might want the file to look different.


All times are GMT -5. The time now is 09:39 PM.