1823113 Members
3370 Online
109646 Solutions
New Discussion юеВ

Static IP

 
Kyle D. Harris
Regular Advisor

Static IP

Good Morning all-
I'm building a server from scratch. I just installed RH 9.0 and selected DHCP during install. I've now got a Static IP address. What do I have to do to configure the static IP address? The more specific the better on the answsers (i'm new) Thanks to all!

Kyle
9 REPLIES 9
Mark Grant
Honored Contributor

Re: Static IP

You can probably find some whiz bang red Hat script to do this. However, I think red hat currently put all there nonsense in /etc/sysconfig. In there is a file called network. Add hostname etc in here. Then go to /etc/sysconfig/network-scripts and edit the script for your interface e.g. ifcfg-eth0 to put in your ip address. Then re-boot.

If you want to do it a sensible way (actually don't bother on red hat)

"ifconfig eth0 your.static.ip.address netmask your.netmask.address." to just set it up without a re-boot to make sure it's ok.
Never preceed any demonstration with anything more predictive than "watch this"
Huc_1
Honored Contributor

Re: Static IP

There is some confusion here If you set up DHCP (server) this is for givin out dynamic addresse to dhcp clients.

before you do your setup be sure of what you have got from your network admin ! a static or a dynamic (usualy the network addresss of the dhcp server

for both set up you will have to use following log in as root

# redhat-config-network

this invokes a setup tool for your network
once in there chose either a static address this will have been given to you by your network admin (ex: 10.3.4.11 ).

Or chose use dhcp

But if I understand you right you got a static address ?

tell use what you have will pick it up from there

J-P


Smile I will feel the difference
Jerome Henry
Honored Contributor

Re: Static IP

From your graphic interface :
select hat / system tools / network configuration, select your device, double click on it, you'll be able to select your static IP and netmask.
From command line, go to
/etc/sysconfig/networking/devices
edit ifcfg-eth0 (if your NIC is eth0, the eth1 and so on if you have several NICs), and put values according to your network, like :
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.0.126
NETMASK=255.255.255.0
USERCTL=yes
PEERDNS=no
TYPE=Ethernet
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.253

save, and :
service network restart.
You are done.

hth

J
You can lean only on what resists you...
Jerome Henry
Honored Contributor

Re: Static IP

BTW,
DEVICE=eth0 is your NIC number, from 0 to ...
BOOTPROTO=none, if static, or BOOTP or DHCP if dynamic
ONBOOT=yes : is the device launched at boot time or later
IPADDR=192.168.0.126 your IP
NETMASK=255.255.255.0 yor mask
USERCTL=yes Can a user (des)activate it, or just root
PEERDNS=no do you address a peer dns
TYPE=Ethernet is it ethernet (or token and so on)
NETWORK=192.168.0.0 network number
BROADCAST=192.168.0.255 as it says
GATEWAY=192.168.0.253 same

hth

J
You can lean only on what resists you...
K.C. Chan
Trusted Contributor

Re: Static IP

AFAIK, the file in /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 if you are using eth0. What I have in my network is just these two param
NETWORKING=yes
HOSTNAME=

in ifcfg-eth0 is
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
NETMASK=
GATEWAY=
IPADDR=
HOSTNAME=

I don't know whay I need two HOSTNAME entry, but I think it is for backward compatibility in regards to redhat version and it never got clean off. I suppose you can just have one hostname entry in the one of the config file only, but I have not got a chance to test it out.

After the entry is done, you do hostname to change the hostname on the fly and /etc/rc.d/init.d/network restart. This should change your network and hostname on the fly without rebooting. As another note, I hope your static ip is UNIQUE, otherwise it could wraek havic in your network.
Reputation of a thousand years can be determined by the conduct of an hour
Kyle D. Harris
Regular Advisor

Re: Static IP

Jerome-

Broadcast, Gateway and Network addresses examples or should i have those in there? Thanks for the help!

Huc-
Yes, my system admin did give me a static IP.
Jerome Henry
Honored Contributor

Re: Static IP

Hi Kyle,
Broadcast, gateway and netmask are given by your admin, my values here are examples.
For the rest, you can use these values. If you post your IP address, I'll give you your probable values... But safest is to ask your admin.

hth

J
You can lean only on what resists you...
Huc_1
Honored Contributor

Re: Static IP

Hello Jerome,mark... Kyle follow advice, ask about the different value to your net admin from there use either of the above tools, advice, will get you there, but we can not inprovise the values whe could only do that if we knew all your enviroment

J-P

Smile I will feel the difference
Jerome Henry
Honored Contributor

Re: Static IP

Hi JP !
Particularly gateway would be a bet, network would be deduced from your IP/mask.

J
You can lean only on what resists you...