There are several ways to configure the network in CentOS.
The first and easiest is to use a DHCP server that exists on our network. If you have an ADSL router it is more likely that this enabled the DHCP server so that any computer can get an IP address and surf.
If installing CentOS has not changed the default configuration of the network, DHCP server is used to obtain a valid IP address, subnet mask, domain name, DNS and gateway.
Sometimes you have to force the DHCP client to renew the ip address. To release the address ip is assigned to our machine currently runs the command dhclient-r
. After releasing the ip address you can re-apply for another with the command dhclient
.
The second is to use the command
- system-config-network
- . This brings up on screen text-based interface to configure the network easily.
If you have not made any changes to the network configuration during installation, the configuration interface will in consultation with a DHCP server. To set a static address, you should select "Using DHCP" with the arrow keys and press the spacebar to remove the asterisk and be allowed to enter data in other fields. If you want to use DHCP, you just have to put the star back to "Using DHCP." Once all the fields, select "Ok" and press "Enter" to return to the previous screen.
With the Tab key you select "Save" and automatically return to the screen. Now to configure DNS, select "Edit DNS configuration" and press "Enter."
Possibly the window that appears will show the data obtained by the DHCP dns.
command system-config-network
modify the files related to network configuration, but the interfaces to load the new configuration is to restart the network service running the command service network restart
.
And lastly, and most complex, is to edit files directly related to the network. Note: These files have more options than are presented here, but suffice to set the network to function properly. For each network interface configuration file exists in "/ etc / sysconfig / network-scripts /". For interface eth0 this file is named "ifcfg-eth0."
# Advanced Micro Devices [AMD] 79c970 [pcnet32 LANCE]
DEVICE = eth0 BOOTPROTO = none
HWADDR = 00:0 c: 29: c7: d3: 5a
ONBOOT = yes NETMASK = 255.255.255.0 IPADDR =
ONBOOT = yes NETMASK = 255.255.255.0 IPADDR = 192.168.1.200 GATEWAY = 192.168.69.1 TYPE = Ethernet The contents of the file indicates the following:
the interface indicates that this file belongs. BOOTPROTO
means using the configuration file. If you put HWADDR indicates the MAC address of the network interface. ONBOOT indicates that this interface must be activated or not each time you start / restart the network service. If yes puts are active and thoughtful
not obviously does not work. NETMASK
indicates the subnet mask.
IPADDR
indicates the IP address of the interface. GATEWAY
indicates the gateway to be used to reach other networks (including the internet).
TYPE indicates that the network interface is ethernet.
In the file / etc / sysconfig / network lists various network options.
- NETWORKING_IPV6 NETWORKING = yes = no HOSTNAME = servidor.trombotic.tic
- The contents of the file reads as follows: NETWORKING indicates that enable network service if you put yes ipv4
- and that does not work if you put not.
- NETWORKING_IPV6 indicates that activates the IPv6 network service (new version of IP protocol that uses 128-bit IP addresses instead of 32bit besides other improvements) if you put yes and no active if you put not. HOSTNAME
- indicates the domain name of the machine.
- The file / etc / resolv.conf contains information necessary for the DNS client. trombotic.tic
- search
- nameserver 192.168.1.1 nameserver 192.168.1.2
The contents of the file indicates the following:
search shows the domain to be added to the machine names that are not fully qualified domain name (FQDN)
- indicates
- nameserver ip address of the DNS server. In the case of several servers, a line for each server. After editing the file, you must restart the network service.
Using the arrow keys is selected from each of the fields and enter the necessary data. when are completed, select "Ok" and automatically returns to the initial window.
With the tab is selected "Save and Close" and press "Enter" for the settings to take effect.
0 comments:
Post a Comment