1. Display NIC configuration
2. Set up IP static address
3. Configure HOSTNAME on machine
4. Set up IP dynamic by DHCP
5. DHCP request/release IP address
6. Disabling interface eth0
7. Enabling interface eth0
8. Display routing table
9. Show ARP protocol cache
10. Set ARP entry
11. Delete particular entry from ARP cache
Display NIC configuration
# ifconfig -aSet up IP static address
ifconfig etho 192.168.56.128 netmask 255.255.255.0 upIn order to plumb this IP address to eth0 interface across reboots, you have to also add the following entries in conf file :
# vi /etc/sysconfig/network-scripts/ifcfg-eth0Should contain the following entries :
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.56.128
HWADDR=08:00:27:98:19:F2
ONBOOT=yes
Configure HOSTNAME on machine
# vi /etc/sysconfig/networkShould contain the following entries :
NETWORKING=yes
HOSTNAME=centos11
and if you want immidiate affect
# hostname centos11Set up IP dynamic by DHCP
Across reboots
# vi /etc/sysconfig/network-scripts/ifcfg-eth0Shoul have the following content :
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=08:00:27:98:19:F2
ONBOOT=yes
Then you have to restart network daemon.
# service network restart
DHCP request/release IP address
Release bounded IP address by dhcp protocol
# dhclient eth0 -r
Request dhcp server for new IP address
# dhclient eth0
Disabling interface eth0
# ifconfig eth0 downOR
# ifdown eth0Enabling interface eth0
# ifconfig eth0 upor
# ifup eth0Display routing table
# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.56.127 0.0.0.0 UG 0 0 0 eth1
or
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.56.127 0.0.0.0 UG 0 0 0 eth1
Show ARP protocol cache
# arp -aSet ARP entry
arp -v -i eth1 -s centos11 00:08:27:32:88:00You have to remember that arp cmd only allows you to add an entry when it finds dns name of centos11. So it must be configured either in
/etc/hosts file or respond to dns resolver.Delete particular entry from ARP cache
# arp -v -i eth1 -d centos44
Brak komentarzy:
Prześlij komentarz