Changes

Jump to: navigation, search

OPS235 Lab 6 - CentOS7

426 bytes added, 13:11, 4 May 2015
no edit summary
# Use the command <code>ifconfig</code> to list active interfaces, you should see one with a name of <code>eth0</code> or a similar name.
# To configure your card with a static address use the following command:
#* :<b><code><span style="color:#3366CC;font-size:1.2em;">ifconfig eth0 192.168.235.13 netmask 255.255.255.0</span></code></b>
# To configure a default gateway for that interface enter the command:
#* : <b><code><span style="color:#3366CC;font-size:1.2em;">route add default gw 192.168.235.1</span></code></b>
# To configure your DNS server edit the file <code>/etc/resolv.conf</code>. Change the <code>nameserver</code> line to be:
#* : <b><code><span style="color:#3366CC;font-size:1.2em;">nameserver 192.168.235.1</span></code></b>
# Confirm your settings work by doing the following:
#* : <b><code><span style="color:#3366CC;font-size:1.2em;">ifconfig</span></code></b>#* :<b><code><span style="color:#3366CC;font-size:1.2em;">route -n</span></code></b>#* : <b><code><span style="color:#3366CC;font-size:1.2em;">ping</span></code></b> your other VM's and centos host.#* : <b><code><span style="color:#3366CC;font-size:1.2em;">ssh</span></code></b><code>ssh</code> to your matrix account to test your DNS.
# Restart the <code>centos3</code> VM, or just wait a few minutes.
# Login and test your configuration again. What happened?
# While we can configure network settings from the command line those settings are not persistent. To configure persistent network configurations we need to edit the configuration files:
Change to the <code>'''/etc/sysconfig/network-scripts</code> ''' directory on <code></code>
#* List the contents of the directory and you should see 2 different types of files, network config scripts and network configuration files.
#* Look for the config file for your original interface, it should be named <code>ifcfg-eth0</code>
#* Make a backup of this file for later reference.
#* Edit the new file for you interface and give it the following settings (or create a brand new file, might be easier than editing the old one):
#**::DEVICE="eth0"#**::IPADDR="192.168.235.13"#**::NETMASK="255.255.255.0"#**::GATEWAY="192.168.235.1"#**::HWADDR="52:54:00:3f:5c:fa" <-- '''use the MAC address for YOUR interface#**::DNS1="192.168.235.1" '''#**::BOOTPROTO="static"#**::ONBOOT="yes"#**::NM_CONTROLLED="yes"#**::IPV6INIT="no"
# Save the file and then restart the network connection by issuing the commands: <code>ifdown eth1</code> and then <code>ifup eth1</code>
# Verify your configuration as you did before.
13,420
edits

Navigation menu