LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Network Interface doesn't show-up New IP Address (https://www.linuxquestions.org/questions/linux-server-73/network-interface-doesnt-show-up-new-ip-address-4175627789/)

moroako 04-16-2018 02:00 PM

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

michaelk 04-16-2018 02:17 PM

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.

moroako 04-16-2018 02:24 PM

Sir michaelk

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

regards

michaelk 04-16-2018 02:36 PM

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

moroako 04-16-2018 03:00 PM

Okay Sir michaelk,

i'm using suse linux enterprise server, tomorrow i will try to push a command as per your advice

michaelk 04-16-2018 03:01 PM

Rebooting or restarting the networking service should also set the IP address.

moroako 04-16-2018 03:11 PM

Sir michaelk

i have one thing a doubting here, how about the ip address of the Gateway and subnet mask ?

michaelk 04-16-2018 05:09 PM

Since those values were already correct no need to specify them in the command.

moroako 04-17-2018 08:48 AM

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

michaelk 04-17-2018 09:08 AM

Code:

ifconfig eth1 172.26.122.74 netmask 255.255.255.128


All times are GMT -5. The time now is 03:33 AM.