您的当前位置:首页正文

AIX 5L网卡管理与配置

2021-03-06 来源:步旅网
AIX 5L网卡管理与配置

AIX中查看系统中的网卡设备

#lsdev -Cc adapter | grep ent

ent0 Available 00-08 10/100/1000 Base-TX PCI-X Adapter (14106902)

ent1 Available 07-08 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) ent2 Available 07-09 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) ent3 Available 0B-08 10/100/1000 Base-TX PCI-X Adapter (14106902) ent4 Available EtherChannel / IEEE 802.3ad Link Aggregation 从上面可以看出,系统中共有四块网卡(ent0~ent3,而ent4是由多块网卡绑定出来的虚拟网卡EtherChannel.

那么,四块网卡具体是插在哪个插槽上的呢?

#lsslot -c pci | grep ent

U787B.001.DNW6FCB-P1-C2 PCI-X capable, 64 bit, 133MHz slot ent3 U787B.001.DNW6FCB-P1-C3 PCI-X capable, 64 bit, 266MHz slot ent0

上述命令显示的是插在PCI插槽上的两块网卡,都是在第一个PCI笼子中,分别在第二个和第三个插槽。另外两块则是主板上内置的网卡,不是插在PCI槽上的。

#lscfg -v | grep ent

Model Implementation: Multiple Processor, PCI bus

ent1 U787B.001.DNW6FCB-P1-T9 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) ent2 U787B.001.DNW6FCB-P1-T10 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) ent3 U787B.001.DNW6FCB-P1-C2-T1 10/100/1000 Base-TX PCI-X Adapter (14106902) ent0 U787B.001.DNW6FCB-P1-C3-T1 10/100/1000 Base-TX PCI-X Adapter (14106902) AIX中,一个网卡在系统中实际上可以看到两个设备接口,en开头的是Ethernet II标准的,et开头的是IEEE 802.3标准的。以太网的帧有两种标准:Ethernet II(或者叫Standard Ethernet)和IEEE802.3,两者主要是标志帧的上层协议的方式不一样,Ethernet II使用了一个TYPE值表示,而IEEE802.3则使用一个数据LENGTH表示。一般来说,Ethernnet II更常用。

#lsdev -Cc if

en0 Defined 00-08 Standard Ethernet Network Interface en1 Defined 07-08 Standard Ethernet Network Interface en2 Defined 07-09 Standard Ethernet Network Interface en3 Defined 0B-08 Standard Ethernet Network Interface en4 Available Standard Ethernet Network Interface et0 Defined 00-08 IEEE 802.3 Ethernet Network Interface et1 Defined 07-08 IEEE 802.3 Ethernet Network Interface et2 Defined 07-09 IEEE 802.3 Ethernet Network Interface et3 Defined 0B-08 IEEE 802.3 Ethernet Network Interface

et4 Defined IEEE 802.3 Ethernet Network Interface lo0 Available Loopback Network Interface 其中lo0表示本地回环接口,也就是127.0.0.1

查看某块网卡的具体属性

#lsattr -El ent1

alt_addr 0x000000000000 Alternate ethernet address True busintr 273 Bus interrupt level False busmem 0xf8120000 Bus memory address False chksum_offload yes Enable hardware transmit and receive checksum True compat_mode no Gigabit Backward compatability True copy_bytes 2048 Copy packet if this many or less bytes True delay_open no Enable delay of open until link state is known True failback yes Enable auto failback to primary True failback_delay 15 Failback to primary delay timer True failover disable Enable failover mode True flow_ctrl yes Enable Transmit and Receive Flow Control True intr_priority 3 Interrupt priority False intr_rate 10000 Max rate of interrupts generated by adapter True jumbo_frames no Transmit jumbo frames True large_send yes Enable hardware TX TCP resegmentation True media_speed Auto_Negotiation Media speed True rom_mem 0xf80c0000 ROM memory address False rx_hog 1000 Max rcv buffers processed per rcv interrupt True rxbuf_pool_sz 2048 Rcv buffer pool, make 2X rxdesc_que_sz True rxdesc_que_sz 1024 Rcv descriptor queue size True slih_hog 10 Max Interrupt events processed per interrupt True tx_que_sz 8192 Software transmit queue size True txdesc_que_sz 512 TX descriptor queue size True use_alt_addr no Enable alternate ethernet address True 查看某个网卡设备接口的属性

#lsattr -El en0

alias4 IPv4 Alias including Subnet Mask True alias6 IPv6 Alias including Prefix Length True arp on Address Resolution Protocol (ARP) True authority Authorized Users True broadcast Broadcast Address True mtu 1500 Maximum IP Packet Size for This Device True netaddr Internet Address True netaddr6 IPv6 Internet Address True netmask Subnet Mask True prefixlen Prefix Length for IPv6 Internet Address True

remmtu 576 Maximum IP Packet Size for REMOTE Networks True rfc1323 Enable/Disable TCP RFC 1323 Window Scaling True security none Security Level True state down Current Interface Status True tcp_mssdflt Set TCP Maximum Segment Size True tcp_nodelay Enable/Disable TCP_NODELAY Option True tcp_recvspace Set Socket Buffer Space for Receiving True tcp_sendspace Set Socket Buffer Space for Sending True #lsattr -El et0

alias4 IPv4 Alias including Subnet Mask True alias6 IPv6 Alias including Prefix Length True arp on Address Resolution Protocol (ARP) True authority Authorized Users True broadcast Broadcast Address True mtu 1492 Maximum IP Packet Size for This Device True netaddr Internet Address True netaddr6 IPv6 Internet Address True netmask Subnet Mask True prefixlen Prefix Length for IPv6 Internet Address True remmtu 576 Maximum IP Packet Size for REMOTE Networks True rfc1323 Enable/Disable TCP RFC 1323 Window Scaling True security none Security Level True state down Current Interface Status True tcp_mssdflt Set TCP Maximum Segment Size True tcp_nodelay Enable/Disable TCP_NODELAY Option True tcp_recvspace Set Socket Buffer Space for Receiving True tcp_sendspace Set Socket Buffer Space for Sending True 修改接口属性,比如设置IP和子网掩码

#chdev -l en1 -a netaddr='192.168.1.1' -a netmask='255.255.255.0' 而ifconfig只能查看和修改网线已经连接好的网卡信息

#ifconfig -a en4:

flags=5e080863,c0

inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255 tcp_sendspace 131072 tcp_recvspace 65536 lo0:

flags=e08084b inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1/0

tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 如果使用ifconfig操作没有连接网络的网卡则会报错

#ifconfig en1 up

0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: The specified device does not exist. smit操作网卡相关命令

————————————————————————

通过lsdev命令可以看到网卡的个数与类型

#lsdev -Cc adapter|grep ent

ent0 Available 08-08 10/100/1000 Base-TX PCI-X Adapter (14106902) ent1 Available 0B-08 10/100/1000 Base-TX PCI-X Adapter (14106902) ent2 Available EtherChannel / IEEE 802.3ad Link Aggregation

ent3 Available 0I-08 10/100/1000 Base-TX PCI-X Adapter (14106902)如,从上面可以看到,en0/1/3是千兆网卡,而ent2则是绑定过的网卡(不是真实的网卡),这个就是EtherChannel (TM), 建立在802.3 快速以太网标准之上,提供了把多个以太网接口的带宽聚合起来的能力。IBM 在AIX上对 Cisco的 EtherChannel 的实现是,把2至4个物理接口(或适配器)定义为一个逻辑接口或通道。这个逻辑接口或通道对上层应用来讲就象是一个以太网接口。

如果想查看以上三个真实的网卡具体在哪个插槽上,可以用如下命令

#lsslot -c pci|grep ent

U5791.001.9180185-P1-C04 PCI-X capable, 64 bit, 133MHz slot ent0 U5791.001.9180185-P2-C02 PCI-X capable, 64 bit, 133MHz slot ent1

U5791.001.9180185-P2-C06 PCI-X capable, 64 bit, 133MHz slot ent3其中,P1 表示第一个PCI笼子,P2表示第二个PCI笼子,C04,C02等则表示在该笼子中对应的是第几个糟位,编号从1开始。在590/595中,对应的背板位置则从左到右的顺序。而550等机型则可以看面板上的标签。

当然,如果想查看任意网卡的详细信息,可以使用lscfg命令,如

#lscfg -vl ent0

ent0 U5791.001.9180185-P1-C04-T1 10/100/1000 Base-TX PCI-X Adapter (14106902)

10/100/1000 Base-TX PCI-X Adapter: Part Number.................00P6130 FRU Number..................00P6130

EC Level....................H12818 Manufacture ID..............YL1021

Network Address.............001125081671 ROM Level (alterable).......GOL021

Device Specific.(YL)........U5791.001.9180185-P1-C04-T1上面详细的限制了网卡的位置,速度类型,型号,网络地址等详细信息。

查看网卡的工作模式,可以用如下命令

#netstat -v ent3 | grep -p “Specific Statistics”

10/100/1000 Base-TX PCI-X Adapter (14106902) Specific Statistics: -------------------------------------------------------------------- Link Status: Up

Media Speed Selected: Auto negotiation Media Speed Running: 1000 Mbps Full Duplex PCI Mode: PCI-X (100-133) PCI Bus Width: 64-bit

„„可以看到红色字体上显示的1000全双工,如果是千兆网卡,则表示网卡工作正常。全双工表示同时发送与接收包,而半双工需要分成两次完成,所以半双工将有很大的性能损耗,如果是连接到交换机,必须要求这里是全双工。

查看网卡的IP可以用ifconfig或者是netstat,如

#ifconfig -a

en3: flags=5e080863,c0

inet 192.168.166.151 netmask 0xffffff00 broadcast 192.168.166.255 tcp_sendspace 131072 tcp_recvspace 65536 en2: flags=4e080863,c0

inet 192.168.167.151 netmask 0xffffff00 broadcast 192.168.167.255 inet 192.168.168.151 netmask 0xffffff00 broadcast 192.168.168.255 tcp_sendspace 131072 tcp_recvspace 65536 lo0: flags=e08084b

inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1/0

tcp_sendspace 65536 tcp_recvspace 65536 #netstat -in

Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll en3 1500 link#2 0.11.25.8.4a.b6 5906447 0 2316411 4 0

en3 1500 192.168.166 192.168.166.151 5906447 0 2316411 4 0

en2 1500 link#3 0.11.25.8.4b.55 1343342735 0 3557846711 3 0

en2 1500 192.168.167 192.168.167.151 1343342735 0 3557846711 3 0

en2 1500 192.168.168 192.168.168.151 1343342735 0 3557846711 3 0

lo0 16896 link#1 1057732 0 1071241 0 0

lo0 16896 127 127.0.0.1 1057732 0 1071241 0 0

lo0 16896 ::1 1057732 0 1071241 0 0

注意,以上的是en2,en3,这里需要说明的是,ent0其实可以分成en0与et0,分别代表以太网第二版与IEEE 802.3接口。

详细属性同样可以通过如下命令查看

#lsattr -El ent0

#lsattr -El en0

#lsattr -El et0

如果想给网卡配置IP地址,可以用smit chinet或者

#chdev -l en1 -a netaddr=’10.0.100.151′ -a netmask=’255.255.255.0′

取消IP地址

#chdev -l en1 -a netaddr=” -a netmask=”

第一次操作,可以用smit tcpip来完成配置工作更简单一些

#smit tcpip

选择Minimum Configuration & Startup

如果想修改网卡的工作模式,可以用如下步骤完成

#chdev -l en1 -a state=’down’

#chdev -l en1 -a state=’detach’

#chdev -l ‘ent1′ -a media_speed=’Auto_Negotiation’

#chdev -l en1 -a state=’up’

其中停止与启动网卡可以用smit chinet代替,修改工作模式可以用smit chgenet代替完成。

详细显示网络接口状态—————— # entstat -d ent0 | grep -i status RJ45 Port Link Status : up # entstat -d ent0

------------------------------------------------------------- ETHERNET STATISTICS (ent0) :

Device Type: IBM 10/100 Mbps Ethernet PCI Adapter (23100020) Hardware Address: 00:02:55:09:75:b2

Elapsed Time: 0 days 2 hours 54 minutes 5 seconds

Transmit Statistics: Receive Statistics: -------------------- ------------------- Packets: 5048 Packets: 13965 Bytes: 1224334 Bytes: 1008055 Interrupts: 14 Interrupts: 13922 Transmit Errors: 0 Receive Errors: 0 Packets Dropped: 0 Packets Dropped: 0 Bad Packets: 0 Max Packets on S/W Transmit Queue: 23 S/W Transmit Queue Overflow: 0

Current S/W+H/W Transmit Queue Length: 1

Broadcast Packets: 7 Broadcast Packets: 6611 Multicast Packets: 2 Multicast Packets: 2 No Carrier Sense: 0 CRC Errors: 0 DMA Underrun: 0 DMA Overrun: 0

Lost CTS Errors: 0 Alignment Errors: 0 Max Collision Errors: 0 No Resource Errors: 0

Late Collision Errors: 0 Receive Collision Errors: 0 Deferred: 0 Packet Too Short Errors: 0 SQE Test: 0 Packet Too Long Errors: 0

Timeout Errors: 0 Packets Discarded by Adapter: 0 Single Collision Count: 0 Receiver Start Count: 0 Multiple Collision Count: 0

Current HW Transmit Queue Length: 1 General Statistics:

------------------- No mbuf Errors: 0

Adapter Reset Count: 0 Adapter Data Rate: 200

Driver Flags: Up Broadcast Running

Simplex AlternateAddress 64BitSupport PrivateSegment DataRateSet

IBM 10/100 Mbps Ethernet PCI Adapter Specific Statistics: ------------------------------------------------ Chip Version: 26

RJ45 Port Link Status : up

Media Speed Selected: Auto negotiation Media Speed Running: 100 Mbps Full Duplex Receive Pool Buffer Size: 384 No Receive Pool Buffer Errors: 0 Inter Packet Gap: 96

Adapter Restarts due to IOCTL commands: 0 Packets with Transmit collisions:

1 collisions: 0 6 collisions: 0 11 collisions: 0 2 collisions: 0 7 collisions: 0 12 collisions: 0 3 collisions: 0 8 collisions: 0 13 collisions: 0 4 collisions: 0 9 collisions: 0 14 collisions: 0 5 collisions: 0 10 collisions: 0 15 collisions: 0 Excessive deferral errors: 0x0

?smit mkinet添加新的网卡接口 ?smit chinet配置网卡接口 ?smit tcpip配置tcpip网络 ?smit mktcpip配置IP地址 ?smit chgenet配置网卡设备 ?smit rminet删除网卡接口

?smit etherchannel配置网卡绑定

?smit inet配置网卡接口,包括mkinet,chinet,rminet等命令入口

因篇幅问题不能全部显示,请点此查看更多更全内容