Ifconfig
Hie
when i type 'ifconfig eth0 192.168.25.1 255.255.255.0' the outcome is 'SIOCSIFADDR : invalid argument', but when i check the ip address using /sbin/ifconfig i see the ip address is updated to 192.168.25.1 and is up. When i restart the linux box,the /sbin/ifconfig is reset to 192.168.100.1 .what should i do so that the linux box /sbin/ifconfig should not change when am rebooting. Thank you for your helping answer in advance. |
Code:
cd /etc |
which distro you are using? i was using "setup" command in centos. then select networking option.
|
The correct syntax would be:
ifconfig eth0 192.168.25.1 netmask 255.255.255.0 You do not mention which distribution but both Fedora,Redhat and Ubuntu have networking configuration utilities that will configure network adapters and save the static IP address settings. |
this is set in this text file: /etc/sysconfig/network-scripts/ifcfg-eth0 if you use good old networking.
if you use NetworkManager, then it's a different story |
For knowledge and future use i want to know how /etc/sysconfig/network-scripts/ifcfg-eth0 should be like.
|
Am using redhat 9
|
ifconfig eth0 192.168.25.1 netmask 255.255.255.0
|
Are you really using "Red Hat 9"? Quoting from wikipedia: Red Hat Linux 9, the final release, hit its official end-of-life on 2004-04-30 If you really are using a re revision this old, you are both setting yourself up for serious security issues and focusing on learning deprecated techniques. If you want the "red hat" experience without paying for RHEL, go with either Fedora or CentOS.
Here is a link to the CentOS documentation, chapter 14 provides information on configuring the network. BTW, CentOS is the free version Red Hat and may be a little bit behind, but should achieve your goals. |
FYI Redhat 9 is extremely obsolete and Fedora 13 is no longer being supported. ifcfg-eth0 is a network configuration file for Redhat base distributions. Here is an example:
Quote:
|
I changed this values in /etc/sysconfig/network-scripts/ifcfg-eth0 file 'BOOTPROTO=static' from 'BOOTPROTO=dhcp' and i added my ip address and netmask.
IPADDR=192.168.25.1 NETMASK=255.255.255.0 |
All times are GMT -5. The time now is 08:16 PM. |