- [root@localhost ~]# ip a
- 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
- link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
- inet 127.0.0.1/8 scope host lo
- valid_lft forever preferred_lft forever
- inet6 ::1/128 scope host
- valid_lft forever preferred_lft forever
- 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
- link/ether 00:0c:29:f0:0c:1c brd ff:ff:ff:ff:ff:ff
- altname enp3s0
- inet 192.168.71.130/24 brd 192.168.71.255 scope global dynamic noprefixroute ens160
- valid_lft 1451sec preferred_lft 1451sec
- inet6 fe80::20c:29ff:fef0:c1c/64 scope link noprefixroute
- valid_lft forever preferred_lft forever
lo接口:
ens160接口:
- [root@localhost ~]# ip link
- 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
- link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
- 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
- link/ether 00:0c:29:f0:0c:1c brd ff:ff:ff:ff:ff:ff
- altname enp3s0
lo接口:
ens160接口:
ip link set ens160 down
ens160为网卡名称
ip link set ens160 down
ip link set eth0 mtu 1400
需要注意的是,修改MTU可能会影响网络连接的稳定性和性能。如果设置得过小,可能会导致网络传输效率降低;如果设置得过大,可能会导致数据包在传输过程中被丢弃。因此,在修改MTU之前,需要了解网络环境的要求和限制,并根据实际情况进行合理设置。