Fedora Core Linux Network Management file and config.
Fedora Core Linux Network Management file and config
Below show list of some network management tools, network files setup and network files configuration files in Fedora Core Linux operating system.
Network file example
The network file contain the information or setting of system network configuration. The network file usually located under /etc/sysconfig/network directory.
[root@fedora ~]# less /etc/sysconfig/network
NETWORKING=yes/no # Presence of network use
NETWORKING_IPV6=yes/no # Presence of Ipv6 network use
HOSTNAME=RedHatA # host name
GATEWAY=193.0.0.1 # Specification of default gateway
NISDOMAIN=dimainnameA # Specification of NIS domain name
Hosts file example
To get more information on hosts (/etc/hosts)
[root@fedora ~]# man hosts
Example of hosts file.
[root@fedora ~]# less /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
Explanations: IP address,hostname,alias(Alias of hostname)
Type of network interface
1. lo (local loop back interface)
lo is recognized only internally of the computer.
Lo IP adress is 127.0.0.1.
2. Ethernet card (ethernet)
eth0,eth1,eth2,,,,
Edit network interface file
The network interface file or scripts usually located under /etc/sysconfig/nework-scripts/ directory.
1. /etc/sysconfig/nework-scripts/ifcfg-lo
2. /etc/sysconfig/nework-scripts/ifcfg-eth0
[root@fedora ~]# /etc/sysconfig/nework-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT=yes # To make sure that the start and stop of these network service automatically control by the scripts.
NAME=loopback
[root@fedora ~]# less /etc/sysconfig/nework-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="none"
IPADDR="10.10.0.235"
NETMASK="255.255.0.0"
ONBOOT="yes"
Using 'ifconfig' command to state the properties of network interface
The example below show the output of the 'ifconfig' command that display the properties of Ethernet card (eth0) and the local loopback address (lo).
[root@fedora ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:FC:1E:36:A5
inet addr:10.10.0.235 Bcast:10.10.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30315 errors:7 dropped:0 overruns:0 frame:0
TX packets:708 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2398091 (2.2 Mb) TX bytes:117446 (114.6 Kb)
Interrupt:5 Base address:0x9000
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:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2868 (2.8 Kb) TX bytes:2868 (2.8 Kb)
(Explanation)
MTU(maximum Transfer Unit)
The maximum value of size of packet which can be forwarded
RX packets: Received number of packets
TX packets: Transmitted number of packets
collisions: Frequency by which collision is caused
txqueuelen: Length of transmission cue
RX bytes: Received number of bytes
TX bytes: Transmitted number of bytes
Start and stop the network interface card on Linux Fedora Core
Using Linux ifconfig command to bring network interface card up and down.
[root@fedora ~]# ifconfig eth0 up
[root@fedora ~]# ifconfig eth0 down
Using Linux ifup and ifdown command to bring network interface card up and down.
[root@fedora ~]# ifup eth0
[root@fedora ~]# ifdown eth0
Using Linux service command to bring network interface card up and down.
[root@fedora ~]# service network stop
[root@fedora ~]# service network start
Using network scrip (locate under /etc/rc.d/init.d/ directory) to start, stop, restart, reload and to display the network status.
[root@core init.d]# /etc/rc.d/init.d/network
Usage: /etc/rc.d/init.d/network {start|stop|restart|reload|status}
Display network status
[root@core init.d]# /etc/rc.d/init.d/network status
Configured devices:
lo eth0
Currently active devices:
lo eth0
To stop network interface
[root@fedora /]# /etc/rc.d/init.d/network stop
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
To start the network inteface
[root@fedora /]# /etc/rc.d/init.d/network start
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
To restart the network interface, shutting down the network interface and then bring the network interface up again.
[root@fedora /]# /etc/rc.d/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Display hostname and change to new host name
Display the host name on Linux Fedora Core.
[root@fedora ~]# hostname
fedora.hacking.com
Change host name using 'hostname' command
[root@fedora ~]# hostname core.hacking.com
[root@fedora ~]# hostname
core.hacking.com
Logout and login again to apply changes.
[root@core ~]# hostname
core.hacking.com
Setup / change the hostname manually
To setup the hostname manually on Linux Fedora Core machine, you need to edit two files: /etc/sysconfig/ network and /etc/ hosts.
1. On the /etc/sysconfig/ network file, modify the hostname:
Configuration example on network file:
NETWORKING=yes
HOSTNAME=fedora.hacking.com
GATEWAY=10.7.0.1
2. On the /etc/ hosts file, modify the hostname:
Configuration example on hosts file:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 fedora.hacking.com fedora localhost.localdomain localhost
Ping Host
The packet is transmitted, and it is confirmed whether the packet reaches host destination correctly.
Please push CTRL-C when the confirmation ends.
1. The example of reaching packet to host.
[root@fedora ~]# ping 10.10.0.233
PING 10.10.0.233 (10.10.0.233) from 10.10.0.235 : 56(84) bytes of data.
Warning: time of day goes back, taking countermeasures.
64 bytes from 10.10.0.233: icmp_seq=0 ttl=128 time=216 usec
64 bytes from 10.10.0.233: icmp_seq=1 ttl=128 time=127 usec
64 bytes from 10.10.0.233: icmp_seq=2 ttl=128 time=137 usec
64 bytes from 10.10.0.233: icmp_seq=3 ttl=128 time=119 usec
64 bytes from 10.10.0.233: icmp_seq=4 ttl=128 time=143 usec
64 bytes from 10.10.0.233: icmp_seq=5 ttl=128 time=125 usec
64 bytes from 10.10.0.233: icmp_seq=6 ttl=128 time=137 usec
--- 10.10.0.233 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.119/0.143/0.216/0.032 ms
2. The example of not reaching packet to host.
[root@fedora ~]# ping 10.10.0.239
PING 10.10.0.239 (10.10.0.239) from 10.10.0.235 : 56(84) bytes of data.
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
From 10.10.0.235: Destination Host Unreachable
--- 10.10.0.239 ping statistics ---
12 packets transmitted, 0 packets received, +9 errors, 100% packet loss
ARP Reference and change in ARP cache
The ARP cache is a correspondence table of the MAC address and Internet Protocol address obtained by ARP.
[root@fedora ~]# arp -a
? (10.10.0.1) at 00:01:30:33:6D:00 [ether] on eth0
? (10.10.0.233) at 00:50:FC:24:D3:8B [ether] on eth0
neat
Neat is a program for a network environmental setting which moves on x window system.
Neat is selected the menu, the program, the system, and the network setting on GNOME
and starts.
Network and Hosts file properties.
Below show the example of network and hosts file properties.
[root@fedora ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fedora.hacking.com
GATEWAY=10.7.0.1
[root@fedora ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 fedora.hacking.com fedora localhost.localdomain localhost
[root@fedora ~]#
Keywords: Linux network management, network file, network configuration files, setup network, network config, Fedora Core, hosts file, sysconfig, arp, ping, change hostname, display hostname, ifconfig, network interface, configure network device.
- 22718 reads
- Email this page
2 comments
issue with network config
Submitted by Amit Chopra (not verified) on Thu, 04/05/2012 - 13:17.Hi,
After restarting the network services my eth0 port configuration losts. what should be the reason.
Hi I got the work around a
Submitted by Amit Chopra (not verified) on Thu, 04/05/2012 - 13:52.Hi I got the work around a bit or i may be near to the solution.
We need to edit two files and then try to restart the network service.
1. /etc/sysconfig/network
2. /etc/sysconfig/network-script/ifcfg_eth0
3. service network restart
in 1st step :- the enteries should be :-
NETWORKING=yes
HOSTNAME=
BOOTPROTO=static
IPADDRESS=
NETMASK=255.255.255.0
GATEWAY=
and
2nd Step :-
DEVICE=eth0
BOOTPROTO=yes
ONBOOT=yes
TYPE=ethernet
3rd step :-
can be :- /sbin/rc.d/init.d/network restart
or
/etc/sysconfig/network restart.
this fixed my problem to an extent.