博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
aix 网络管理命令
阅读量:6525 次
发布时间:2019-06-24

本文共 5261 字,大约阅读时间需要 17 分钟。

ifconfig 命令

显示网络所有接口 ifconfig -a
-bash-3.2$ ifconfig -a
en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
        inet 99.99.99.35 netmask 0xffffff00 broadcast 99.99.99.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
        inet 99.99.99.89 netmask 0xffffff00 broadcast 99.99.99.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

只显示网络接口,不带其它信息。ifconfig -l

-bash-3.2# ifconfig -l
en0 en1 lo0

关闭与启动网络接口 ifconfig en1 up/down

-bash-3.2# ifconfig en1 down
-bash-3.2# ifconfig en1 up

查看已启动的网络接口 
-bash-3.2# ifconfig -au
en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
        inet 99.99.99.35 netmask 0xffffff00 broadcast 99.99.99.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

 

-bash-3.2# ifconfig -lu

en0 lo0

查看已关闭的网络接口
-bash-3.2# ifconfig -ad
en1: flags=1e080862,480<BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
        inet 99.99.99.89 netmask 0xffffff00 broadcast 99.99.99.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1

 

-bash-3.2# ifconfig -ld

en1

-bash-3.2# netstat -in #带*号的显示为关闭的网络接口,此命令可以查看本机的IP地址
Name  Mtu   Network     Address           ZoneID    Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      ee.cb.f0.2.30.2        -   477369     0    24513     0     0
en0   1500  99.99.99    99.99.99.35            -   477369     0    24513     0     0
en1*  1500  link#3      ee.cb.f0.2.30.3        -     2539     0       84     0     0
en1*  1500  99.99.99    99.99.99.89            -     2539     0       84     0     0
lo0   16896 link#1                             -    93601     0    93608     0     0
lo0   16896 127         127.0.0.1              -    93601     0    93608     0     0
lo0   16896 ::1                                0    93601     0    93608     0     0

 

可以使用ping命令测试网络的连通性

ping -c 5 99.99.99.35

 

 

netstat 命令

显示网络接口的格式,是否有多错误的数据包。
-bash-3.2$ netstat -i
Name  Mtu   Network     Address           ZoneID    Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      ee.cb.f0.2.30.2        -   478409     0    24611     0     0
en0   1500  99.99.99    peng2012               -   478409     0    24611     0     0
en1*  1500  link#3      ee.cb.f0.2.30.3        -     2539     0       84     0     0
en1*  1500  99.99.99    99.99.99.89            -     2539     0       84     0     0
lo0   16896 link#1                             -    93767     0    93774     0     0
lo0   16896 127         loopback               -    93767     0    93774     0     0
lo0   16896 ::1                                0    93767     0    93774     0     0

显示本机的路由表
-bash-3.2$ netstat -rn
Routing tables
Destination        Gateway           Flags   Refs     Use  If   Exp  Groups

Route Tree for Protocol Family 2 (Internet):

99.99.99.0         99.99.99.35       UHSb      0         0 en0      -      -   =>
99.99.99.0         99.99.99.89       UHSb      0         0 en1      -      -   =>
99.99.99/24        99.99.99.35       U         1     20417 en0      -      -   =>
99.99.99/24        99.99.99.89       U         0        53 en1      -      -
99.99.99.35        127.0.0.1         UGHS      1       509 lo0      -      -
99.99.99.89        127.0.0.1         UGHS      0        17 lo0      -      -
99.99.99.255       99.99.99.35       UHSb      0         4 en0      -      -   =>
99.99.99.255       99.99.99.89       UHSb      0         0 en1      -      -
127/8              127.0.0.1         U        13     93148 lo0      -      -

显示本机所开启服务netstat -a (显示套接字,不显示端口号)
netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  *.*                    *.*                    CLOSED
tcp        0      0  *.*                    *.*                    CLOSED
tcp4       0      0  *.*                    *.*                    CLOSED
tcp4       0      0  *.daytime              *.*                    LISTEN
tcp        0      0  *.ftp                  *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
tcp        0      0  *.telnet               *.*                    LISTEN
tcp4       0      0  *.smtp                 *.*                    LISTEN
tcp4       0      0  *.time                 *.*                    LISTEN
tcp4       0      0  *.sunrpc               *.*                    LISTEN
tcp        0      0  *.smux                 *.*                    LISTEN
tcp        0      0  *.exec                 *.*                    LISTEN
tcp        0      0  *.login                *.*                    LISTEN
tcp        0      0  *.shell                *.*                    LISTEN
tcp        0      0  *.rmc                  *.*                    LISTEN
tcp4       0      0  *.writesrv             *.*                    LISTEN
tcp        0      0  *.5335                 *.*                    LISTEN
tcp        0      0  *.5336                 *.*                    LISTEN
tcp        0      0  *.wbem-htt             *.*                    LISTEN
tcp        0      0  *.wbem-htt             *.*                    LISTEN
tcp        0      0  *.6988                 *.*                    LISTEN
......

显示本机所开启服务(显示端口号) netstat -an
netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  *.*                    *.*                    CLOSED
tcp        0      0  *.*                    *.*                    CLOSED
tcp4       0      0  *.*                    *.*                    CLOSED
tcp4       0      0  *.13                   *.*                    LISTEN
tcp        0      0  *.21                   *.*                    LISTEN
tcp4       0      0  *.22                   *.*                    LISTEN
tcp        0      0  *.23                   *.*                    LISTEN
tcp4       0      0  *.25                   *.*                    LISTEN
tcp4       0      0  *.37                   *.*                    LISTEN
tcp4       0      0  *.111                  *.*                    LISTEN
tcp        0      0  *.199                  *.*                    LISTEN
tcp        0      0  *.512                  *.*                    LISTEN
tcp        0      0  *.513                  *.*                    LISTEN
tcp        0      0  *.514                  *.*                    LISTEN
tcp        0      0  *.657                  *.*                    LISTEN
tcp4       0      0  *.1334                 *.*                    LISTEN
tcp        0      0  *.5335                 *.*                    LISTEN
tcp        0      0  *.5336                 *.*                    LISTEN
tcp        0      0  *.5988                 *.*                    LISTEN
tcp        0      0  *.5989                 *.*                    LISTEN
tcp        0      0  *.6988                 *.*                    LISTEN
.....

显示本机的端口号21是否开启
netstat -an|grep 21.

设置主机IP地址 smit mktcpip (smit tcpip再进一步选择)

                               Minimum Configuration & Startup

        To Delete existing configuration data, please use Further Configuration menus

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]

* HOSTNAME                                           [peng2012]
* Internet ADDRESS (dotted decimal)                  [99.99.99.35]
  Network MASK (dotted decimal)                      [255.255.255.0]
* Network INTERFACE                                   en0
  NAMESERVER
           Internet ADDRESS (dotted decimal)         []
           DOMAIN Name                               []
  Default Gateway
       Address (dotted decimal or symbolic name)     []
       Cost                                          []                                    #
       Do Active Dead Gateway Detection?              no                                  +
[MORE...2]

F1=Help                F2=Refresh             F3=Cancel              F4=List

F5=Reset               F6=Command             F7=Edit                F8=Image
F9=Shell               F10=Exit               Enter=Do
 

本文转自 pk2008 51CTO博客,原文链接:http://blog.51cto.com/837244/1074175

转载地址:http://zonbo.baihongyu.com/

你可能感兴趣的文章
bzoj2754
查看>>
redis liunx下安装和配置
查看>>
Asp.Net MVC 学习心得 之 View
查看>>
STL - Map - 运行期自定义排序
查看>>
Oil Deposits
查看>>
poj3984 迷宫问题(简单搜索+记录路径)
查看>>
Linux 服务器buff/cache清理
查看>>
算法试题 及其他知识点
查看>>
php课程---Json格式规范需要注意的小细节
查看>>
hadoop hdfs notes
查看>>
Java反射机制详解(3) -java的反射和代理实现IOC模式 模拟spring
查看>>
(2编写网络)自己动手,编写神经网络程序,解决Mnist问题,并网络化部署
查看>>
【转】如何使用分区助手完美迁移系统到SSD固态硬盘?
查看>>
NIO框架入门(四):Android与MINA2、Netty4的跨平台UDP双向通信实战
查看>>
ios兼容iphonex刘海屏解决方案
查看>>
就是要你懂TCP -- 握手和挥手
查看>>
Andrew Ng机器学习公开课笔记 -- Regularization and Model Selection
查看>>
《Python游戏编程快速上手》一1.3 如何使用本书
查看>>
《Android游戏开发详解》——第1章,第1.3节声明和初始化变量
查看>>
《Visual Studio程序员箴言》----1.2 滚动与导航
查看>>