LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-16-2018, 02:00 PM   #1
moroako
LQ Newbie
 
Registered: Apr 2018
Posts: 9

Rep: Reputation: Disabled
Unhappy Network Interface doesn't show-up New IP Address


hi Linux Team,

I did change a new IP address of our Data Server by writing the command below but after saving and check the network interface status it shows that the IP address doesn't change

vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
WIRELESS_EMC_key=""
MII_NOT_SUPPORTED=yes
IPADDR=172.26.122.74
NETMASK=255.255.255.128
GATEWAY=172.26.122.254
DHCP_HOSTNAME=data1



the result for ifconfig -a

eth1

link encap:Ethernet HWaddr 00:31:56:B1:A56E
inet addr:172.27.122.70 Bcast:172.27.122.255
Mask:255.255.255.128 UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b)) TX bytes:0 (0.0 b)
interrupt:16 Memory:da100000-da330000
 
Old 04-16-2018, 02:17 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
You only modified the configuration file which is only read when the networking init script is ran. To immediately change the IP address you need to restart networking or use either ipconfig or ip commands to directly configure the IP address.
 
Old 04-16-2018, 02:24 PM   #3
moroako
LQ Newbie
 
Registered: Apr 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sir michaelk

please help me how to do direct configuring the IP address, i'm just new in linux environment

regards
 
Old 04-16-2018, 02:36 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
What linux distribution/version are you running? You must be root or use sudo.

ifconfig eth1 172.26.122.74

ip addr add 172.26.122.74/25 dev eth1
 
Old 04-16-2018, 03:00 PM   #5
moroako
LQ Newbie
 
Registered: Apr 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Okay Sir michaelk,

i'm using suse linux enterprise server, tomorrow i will try to push a command as per your advice
 
Old 04-16-2018, 03:01 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
Rebooting or restarting the networking service should also set the IP address.
 
Old 04-16-2018, 03:11 PM   #7
moroako
LQ Newbie
 
Registered: Apr 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sir michaelk

i have one thing a doubting here, how about the ip address of the Gateway and subnet mask ?
 
Old 04-16-2018, 05:09 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
Since those values were already correct no need to specify them in the command.
 
Old 04-17-2018, 08:48 AM   #9
moroako
LQ Newbie
 
Registered: Apr 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sir michaelk

after am writing the command


ifconfig eth1 172.26.122.74

ip addr add 172.26.122.74/25 dev eth1


see below the result of the ifconfig


eth1

link encap:Ethernet HWaddr 00:31:56:B1:A56E
inet addr:172.26.122.74 Bcast:172.27.255.255
Mask:255.255.0.0 UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b)) TX bytes:0 (0.0 b)
interrupt:16 Memory:da100000-da330000

it's generated different IP for Broadcast and Subnet mask address
 
Old 04-17-2018, 09:08 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
Code:
ifconfig eth1 172.26.122.74 netmask 255.255.255.128
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] when i type in ifconfig it doesn`t show me my IP address Changedirectory Linux - Newbie 6 03-26-2016 04:13 AM
Show message when network interface is on. AndreiM Linux - Newbie 1 09-01-2015 12:39 AM
[SOLVED] changed IP address on bonded interface, now both addresses show? ciscochic Linux - Networking 2 06-25-2013 04:34 PM
how to show network interface card (NIC) info like IP, netmask tnght2001 Linux - General 1 06-23-2010 07:00 AM
In FC6 network interface doesn't come up if 'service network restart' command is run rajat Linux - Networking 2 05-02-2007 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration