LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Loosing IP configuration after reboot (https://www.linuxquestions.org/questions/linux-networking-3/loosing-ip-configuration-after-reboot-517382/)

makram.ng 01-08-2007 06:04 AM

Loosing IP configuration after reboot
 
Hi everybody

I am new to this forum. I have a problem with one of my production servers which is running under Linux Suse 9.
The problem is that after I configure the NIC (with yast tool) all is ok. the ifconfig returns the correct values and I can ping to remote IP addresses, however, after rebooting, I loose the whole configuration and I should re-configure my NIC once for each reboot.

Is there a way to make this configuration permanently ?

Thanks in advance for your help

rylan76 01-08-2007 08:00 AM

Well, once you've setup your configuration using yast, do this in a terminal:

[rylan@StefanLinux ~]$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.254.255.0 * 255.255.255.0 U 0 0 0 eth0
default 192.254.255.100 0.0.0.0 UG 0 0 0 eth0
[rylan@StefanLinux ~]$

Make a note of the value in the "default" line (192.254.255.100) - this is your gateway.

To setup the above manually you need to do:

/sbin/ifconfig eth0 192.254.255.20 netmask 255.255.255.0 broadcast 192.254.255.255 up

route add default gw 192.254.255.100 eth0

Of course, the 192.254.255.20 is my IP address, and that you cannot get off the route command. Instead, call ifconfig to get your IP address assigned with yast:

[rylan@StefanLinux ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:22:A4:47:61
inet addr:192.254.255.20 Bcast:192.254.255.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6819 errors:0 dropped:0 overruns:0 frame:0
TX packets:6700 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3391379 (3.2 MiB) TX bytes:965585 (942.9 KiB)
Interrupt:225 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:225 errors:0 dropped:0 overruns:0 frame:0
TX packets:225 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:483988 (472.6 KiB) TX bytes:483988 (472.6 KiB)

[rylan@StefanLinux ~]$

Thus, you then just need to substitute your correct address, and place the following into your /etc/rc.local file. This will then get run each time the PC is started up:

Code:

/sbin/ifconfig eth0 192.254.255.20 netmask 255.255.255.0 broadcast 169.254.255.255 up

route add default gw 192.254.255.100 eth0

with, of course, your yast-configured addresses substituted.


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