HOW TO assign IP in REDHAT 6?


 
Thread Tools Search this Thread
Operating Systems Linux HOW TO assign IP in REDHAT 6?
# 1  
Old 05-24-2012
Question HOW TO assign IP in REDHAT 6?

Hi Guys,

It may sound silly questions but I am really confused and forgot the sequence to set IP in REDHAT 6.

1st type
system-config-network

then I give IP as 192.168.1.78
Subnet as 255.255.255.0
Then do
/etc/init.d/network restart

Then when I check with ifconfig eth0 it does not show that IP
I do restart /etc/init.d/Networkmanager restart too.


The Network Icon at the right hand side above shows red cross mark.

I had set IP in RHEL 6 in past but not I dont know what I am missing?

Do I need to give any entry in /etc/resolv.conf ?

Please guide.
# 2  
Old 05-24-2012
Please add the below entries in ifcfg-eth0 file.
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.78
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255 TYPE=Ethernet

After /etc/init.d/network restart it will work.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Assign value to variable

Hi Guys, I need to assign the value of which has rows to a variable, Can you advise how to do that hive --orcfiledump /hdfs_path/ | grep "Rows" Rows: 131554 I need to assign this row count itself to a unix variable count=$(hive --orcfiledump /hdfs_path/ | grep "Rows") Expected ... (6 Replies)
Discussion started by: Master_Mind
6 Replies

2. Shell Programming and Scripting

Check assign

I have a person script which has a following statement. BUILD_FOLDER=$2 i=$((${#BUILD_FOLDER}-1)) if then BUILD_FOLDER=$BUILD_FOLDER/ #echo $BUILD_FOLDER else echo " " #echo $BUILD_FOLDER fi What and how this statement works ? i=$((${#BUILD_FOLDER}-1)) (5 Replies)
Discussion started by: ilugopal
5 Replies

3. UNIX for Advanced & Expert Users

Sort command results are different in Redhat 4 vs Redhat 5

Hi, I am having a text file with the following contents ########### File1 ########### some page1.txt text page.txt When I sort this file on Red Hat 5, then I get the following output ########### File1 ########### page1.txt page.txt some (3 Replies)
Discussion started by: sarbjit
3 Replies

4. Shell Programming and Scripting

how to assign value

#! /bin/bash if ; then echo "Set number " else k=$1 sqlplus ${scheme}/${apsswd}@${server} @query.sql $k fi file query.sql looks like this select * from tab1 where number =${k}; =================================== it doesnt work my question is how to assign k value in last... (2 Replies)
Discussion started by: kvok
2 Replies

5. Shell Programming and Scripting

Assign the value

DATA --------------- 0 Please tell me, if the file contains 0 after --. then assign the value to variable $var=false, DATA --------------- 1 then $var=true, (2 Replies)
Discussion started by: sandy1028
2 Replies

6. Shell Programming and Scripting

Using bc to assign value

Friends here is code which is used to add floating point using bc, but I m not getting any output instead some errors. 1 #!/bin/bash 4 if 5 then 6 echo "Our input is from a Device" 7 while read myline 8 do 9 10 total= `echo $total + $myline... (2 Replies)
Discussion started by: navjinder
2 Replies

7. Shell Programming and Scripting

Assign a sting to a name?

i want to assign a anme for a string, i got the things below, but it doesn't work. MParc1=`` if then $MPrac1=`Prac1` # assign $MPrac1 to Prac1 else $MPrac1=`` #assigne $MPrac1 to nothing fi echo "${MPrac1} >>file Output: (if num is 0) Prac1 can you please... (6 Replies)
Discussion started by: mingming88
6 Replies

8. Shell Programming and Scripting

assign a value to a variable

I have a list of names in a file. i want to assign those names to a variable in such a manner eg: $cat file.txt pete lisa john var=pete-lisa-john how do i do this in shell scripting? (10 Replies)
Discussion started by: Shivdatta
10 Replies

9. Shell Programming and Scripting

assign a value to variable

I have to assign a result of a query to a vairable like this how can i do this Query = select count(*) from table x=`db2 ${Query}| sed -n '4p'` but this doesn't work, is there any other way to assign the result without redirecting the result to temp file. . Thanks Mark. (3 Replies)
Discussion started by: markjason
3 Replies

10. UNIX for Dummies Questions & Answers

assign to variable

why i can't use this command: echo $arg | cut -c 1,2 | read remainArg or echo $arg | cut -c 1,2 | read $remainArg so that the result will be assign to remainArg. Anyway to do this? :) (1 Reply)
Discussion started by: AkumaTay
1 Replies
Login or Register to Ask a Question