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 |
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.
|
Sir michaelk
please help me how to do direct configuring the IP address, i'm just new in linux environment regards |
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 |
Okay Sir michaelk,
i'm using suse linux enterprise server, tomorrow i will try to push a command as per your advice |
Rebooting or restarting the networking service should also set the IP address.
|
Sir michaelk
i have one thing a doubting here, how about the ip address of the Gateway and subnet mask ? |
Since those values were already correct no need to specify them in the command.
|
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 |
Code:
ifconfig eth1 172.26.122.74 netmask 255.255.255.128 |
All times are GMT -5. The time now is 03:33 AM. |