In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to view solaris network configuration information", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to view solaris network configuration information" this article.
First log in to the SOLARIS system and execute the following instructions:
# netstat-I
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
Lo0 8232 loopback localhost slightly … ...
Le0 1500 192.1.1.0 sunspy slightly … ...
Or
# ifconfig-a
Lo0: flags=849mtu 8232
Inet 127.0.0.1 netmask ff000000
Le0: flags=863mtu 1500
Inet 192.1.1.2 netmask ffffff00 broadcast 192.1.1.255
Among them, "netstat-I" can successfully return network card names under most UNIX operating systems, while "ifconfig-a" has some limitations, only under SUN's Solaris system can return all network card names.
In the returned result, the leftmost column is the name of the Nic:
Lo0 is a virtual network card pointing to the machine, called the loopback network card, and the user does not need to do anything about it.
Le0 refers to the first 10Mbps Ethernet card, which is the name of the network card we want to get.
The naming rules for network cards of SUN workstations or servers are le0, le1, le2. Represent the first, second and third 10Mbps Ethernet cards respectively, using hme0, hme1, hme2... Represents the first, second and third 100Mbps Ethernet cards, respectively. Other companies' products, such as IBM, HP and SGI, all have their own naming methods.
B) configure IP address and subnet mask with ifconfig
For example, if we want to configure an IP address of 162.105.130.100 with a subnet mask of 255.255.255.0, we must first log in as superuser root. Then type the following directive:
# ifconfig le0 162.105.130.100 netmask 255.255.255.0
The purpose of this directive is to configure the IP address of the network card le0 to 162.105.130.100 and the subnet mask to 255.255.255.0.
The ifconfig directive is described in more detail below:
Instruction location: in the / usr/sbin/ directory.
Function: configure network card parameters (must be executed by superuser).
Instruction format: ifconfig interface [address_family]
[address [dest_address]] [up] [down]
[netmask mask] [broadcast address] [mtu n]
Where interface refers to the name of the network card, that is, the "le0" typed on the command line, is the name of the network card we obtained in the previous step, which specifies which network card to configure.
There are optional parameters in brackets []. We just list the more commonly used parameters:
Address_family refers to the address type, which is inet, which is the commonly used IP address, so this item is often omitted.
Address is the address that needs to be configured. For the inet type of province, it is the IP address, such as 162.105.130.100 on the command line.
Dest_address is only used when configuring SLIP dial-up networking, and generally does not need to be configured
Up/down means to enable or disable the network card.
Netmask mask is the subnet mask to be configured, where netmask is the keyword, and mask should be replaced with the contents of the subnet mask in actual use, such as "netmask 255.255.255.0". Many configuration errors are caused by the omission of the keyword netmask, so please pay attention to it.
Broadcast address is to configure the broadcast address, where broadcast is the keyword, and address should be replaced with the content of the broadcast address in actual use. Generally, the subnet mask is specified, and the system will automatically calculate the broadcast address, so the broadcast address is often omitted in the configuration.
Mtu is the largest transmission unit, where mtu is the keyword, n is the maximum allowable value of the data frame (maximum transmission unit), and the Ethernet card saves 1500 bytes and does not need to be manually configured by the user.
C) check the working status of the network card
The easiest way is to press the person command:
# ifconfig le0
Le0: flags=863mtu 1500
Inet 162.105.130.100 netmask ffffff00 broadcast 162.105.130.255
First of all, we need to check whether the network card is UP or DOWN;, whether it is broadcast (BROADCAST) for Ethernet cards, what is the maximum transmission unit (mtu), whether the IP address of the network card is correct (162.105.130.100), whether the subnet mask is correct (hexadecimal ffffff00 is converted to decimal, that is, 255.255.255.0), and whether the broadcast address is correct (162.105.130.255).
If you want to further analyze the working status of the network card, you can type the following instruction:
# netstat-I
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
Lo0 8232 loopback localhost 23769 0 23769 0 0 0
Le0 1500 162.105.130.0 162.105.130.100 1269605 0 36394 1 56 0
What we need to observe is the status of the network card le0, the maximum transmission unit is 1500, the network address is 162.105.130.100, the IP address is 162.105.130.100, the total number of IP packets received is 1269605, the total number of IP packets sent is 36394, and the number of collision packets is 56. It can be seen that the working state of the network card is basically normal.
(2) confirm the provincial gateway: use netstat-r to check whether the provincial gateway is configured correctly.
You can also change the default gateway by entering / etc/defaultrouter; enter / etc/hosts to view the host corresponding to the network card.
Type the following instruction:
# netstat-r
Routing Table:
Destination Gateway Flags Ref Use Interface
--
Localhost localhost UH 0 0 lo0
162.105.130.0 sunspy U 3 2 le0
BASE-ADDRESS.MCAST.NET sunspy U 3 0 le0
Default 162.105.130.1 UG 0 182
(3) DNS client
Generate or overwrite the contents of the file / etc/resolv.conf as follows:
Domain pku.edu.cn
Nameserver 202.112.7.13
Nameserver 202.112.7.12
Nameserver 162.105.129.27
Domain and nameserver are keywords, and the contents should be filled in as needed.
Domain: the domain name of the domain in which it resides. When a user queries a host name, the domain name is automatically added after the host name.
(4) activate or close the network card:
Optional after ifconfig le0 plumb (up)
Optional after ifconfig pcn0 unplumb (down)
Dynamic allocation
Ifconfig le0 dhcp
Then manually configure dns and so on:
Sys-unconfig can be configured like a fool, and the system will restart after running.
Testing with ping and nslookup
The above is all the contents of the article "how to View solaris Network configuration Information". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.