Basic Networking Commands



ifconfig


Used to determine what IP address you have, the equivalent of the ipconfig command in Windows. You can use the command without parameters to view all interfaces, or you can be interface specific, e.g.[root@esx1host] # ifconfig vswif0vswif0 Link encap:Ethernet HWaddr 00:50:56:49:96:03

inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:4867312 errors:0 dropped:0 overruns:0 frame:0

TX packets:1980227 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:1632239875 (1556.6 Mb) TX bytes:138260324 (131.8 Mb)

Notice this is a quick way of viewing your COS virtual MAC address alongside the IP address. Also note, you don’t see the additional optional IP parameters like gateway and DNS servers.

ping
Our favourite IP connectivity tool; I love the name Packet InterNetwork Groper! Anyway, there are a couple of very useful switches we can use with ping.If you are testing frame sizes, you can force ping not to fragment with the -f switch.
/sbin/arping
This is a similar utility to ping, but uses Address Resolution Protocol (ARP) and so the result will only be for local subnet resources, either another host or a gateway.[root@esx1host sbin]# arping -I vswif0 -c 2 192.168.1.1ARPING 192.168.1.1 from 192.168.1.7 vswif0

Unicast reply from 192.168.1.1 [00:50:56:48:F3:AC] 0.912ms

Unicast reply from 192.168.1.1 [00:50:56:48:F3:AC] 0.765ms

Sent 2 probes (1 broadcast(s))

Received 2 response(s)

Notice in the reply we see the MAC address of the target for the

arp
If you need to view or modify the arp cache in the service console, we can use the arp command.[root@esx1host]# arp -avc.lab.taupoconsulting.com (192.168.1.200) at 00:0C:29:8D:F3:65 [ether] on vswif0

remote7.lab.taupoconsulting.com (192.168.1.70) at 00:50:56:84:19:56 [ether] on vswif0

remote7.lab.taupoconsulting.com (192.168.1.70) at 00:50:56:84:19:56 [ether] on vswif0

It’s unlikely you will need static arp entries, but it can be done using the -s switch.

ethtool
This command can be used to view and configure the Ethernet interfaces in your ESX host. We didn’t use this tool very often until ESX 3.5, when we started to work with Distributed Power Management (DPM); an experimental feature of DRS clusters.The output of this tool provides a load of information about the network cards, but of particular interest now is the support for Wake-on-LAN (WoL). DPM makes use of this NIC feature and so we need to check that our NICs both support the function AND have the function enabled. The ethtool allows us to view and set this functionality.# ethtool vmnic1

Settings for vmnic1:

Supported ports: [ TP ]

Supported link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Advertised auto-negotiation: Yes

Speed: 100Mb/s

Duplex: Full

Port: Twisted Pair

PHYAD: 1

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: g

Wake-on: g

Link detected: yes

If we noted that our NIC supported WoL but it was not currently enabled, then we could use this tool to effect the change.

# ethtool -s vmnic1 wol g




You can leave a response, or trackback from your own site.


Further Reading
    None Found




Leave a Reply

Anti-Spam Quiz:

Twitter Delicious Facebook Digg Stumbleupon Favorites More
334 queries in 3.394 seconds.