Assigning an IP address
Computers may be assiged a static IP address or assigned one dynamically.
Static IP address assignment
Choose one of the following methods:
- Command Line:
/sbin/ifconfig eth0 192.168.10.12
Network address by convention would be the lowest: 192.168.10.0
- Broadcast address by convention would be the highest: 192.168.10.255
- The gateway can be anything, but following convention: 192.168.10.1
- Note: the highest and lowest addresses are based on the netmask. The previous example is based on a netmask of 255.255.255.0
- Red Hat / Fedora GUI tools:
- /usr/bin/neat Gnome GUI network administration tool. Handles all interfaces. Configure for Static IP or DHCP client. (First available with Red Hat 7.2.)
- /usr/bin/netcfg (Handles all interfaces) (last available in Red Hat 7.1)
- Red Hat / Fedora Console tools:
- /usr/sbin/system-config-network-tui (Text User Interface)
- /usr/sbin/netconfig (Only seems to work for the first network interface eth0 but not eth1,...)
- Directly edit configuration files/scripts. See format below.
The ifconfig command does NOT store this information permanently. Upon reboot this information is lost. (Manually add the commands to the end of the file /etc/rc.d/rc.local to execute them upon boot.) The commands netcfg and netconfig make permanent changes to system network configuration files located in /etc/sysconfig/network-scripts/, so that this information is retained.
The IANA has allocated IP addresses in the range of 192.168.0.0 to 192.168.255.255 for private Ubuntu / Debian IP Configuration Files:
Static IP Example
Dynamic IP (DHCP) Example
- lo: Loopback interface (network within your system without slowing down for the real ethernet based network)
- eth0: First ethernet interface card
- wlan0: First wireless network interface
Red Hat / Fedora Core IP Configuration Files
The Red Hat configuration tools store the configuration information in the file /etc/sysconfig/network.
They will also allow one to configure routing information.File: /etc/sysconfig/network.
Static IP address Configuration: (Configure gateway address)
OR for DHCP client configuration
Gateway is assigned by DHCP server.) OR for NIS client configuration:
File (Red Hat/Fedora)
(S.u.s.e.: /etc/sysconfig/network/ifcfg-eth-id-XX:XX:XX:XX:XX) This file used by the command scripts ifup and ifdown.
Related Online Articles:
No comment yet. Be the first to post a comment.