码迷,mamicode.com
首页 > Web开发 > 详细

Redhat7 network

时间:2015-11-28 23:18:10      阅读:733      评论:0      收藏:0      [点我收藏+]

标签:

  ip addr                       查看IP

  ifconfig

ip -s link show ens33   查看网卡流量

ip route                      查看路由

route -n

ping -c 3 192.168.1.1

tracepath 8.8.8.8 –n

traceroute 8.8.8.8

ss –lnt                      查看本地监听的TCP端口

[root@sky ~]# ss -lnt
State      Recv-Q Send-Q                                               Local Address:Port                                                 Peer Address:Port
LISTEN     0      100                                                      127.0.0.1:25                                                              *:*
LISTEN     0      128                                                              *:60927                                                           *:*
LISTEN     0      128                                                              *:111                                                             *:*
LISTEN     0      128                                                              *:22                                                              *:*
LISTEN     0      128                                                      127.0.0.1:631                                                             *:*
LISTEN     0      100                                                            ::1:25                                                             :::*
LISTEN     0      128                                                             :::39912                                                          :::*
LISTEN     0      128                                                             :::111                                                            :::*
LISTEN     0      128                                                             :::80                                                             :::*
LISTEN     0      128                                                             :::22                                                             :::*
LISTEN     0      128                                                            ::1:631                                                            :::*
LISTEN     0      128                                                             :::23                                                             :::*
[root@sky ~]# netstat -anpt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2127/master
tcp        0      0 0.0.0.0:60927           0.0.0.0:*               LISTEN      1637/rpc.statd
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1295/rpcbind
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1108/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      2646/cupsd
tcp6       0      0 ::1:25                  :::*                    LISTEN      2127/master
tcp6       0      0 :::39912                :::*                    LISTEN      1637/rpc.statd
tcp6       0      0 :::111                  :::*                    LISTEN      1295/rpcbind
tcp6       0      0 :::80                   :::*                    LISTEN      5006/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      1108/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      2646/cupsd
tcp6       0      0 :::23                   :::*                    LISTEN      1/systemd
tcp6       0    157 192.168.1.128:23        192.168.1.101:51008     ESTABLISHED 1/systemd

nmcli配置网络  (nmcli和networkmanager配置网络)

显示所有连接

[root@sky ~]# nmcli connection show
名称  UUID                                  类型            设备
eth0  8071cc7b-d407-4dea-a41e-16f7d2e75ee9  802-3-ethernet  ens33

 

nmcli connection show eth0     查看网络设备信息

[root@sky ~]# nmcli connection show eth0
connection.id:                          eth0
connection.uuid:                        8071cc7b-d407-4dea-a41e-16f7d2e75ee9
connection.interface-name:              --
connection.type:                        802-3-ethernet
connection.autoconnect:                 yes
connection.timestamp:                   1448718817
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:
connection.gateway-ping-timeout:        0
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          yes
802-3-ethernet.mac-address:             00:0C:29:25:CD:BF
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:                     自动
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:
ipv4.method:                            manual
ipv4.dns:                               8.8.8.8, 8.8.4.4
ipv4.dns-search:
ipv4.addresses:                         { ip = 192.168.1.128/24, gw = 192.168.1.1 }
ipv4.routes:
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            ignore
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.routes:
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (未知)
ipv6.dhcp-hostname:                     --
GENERAL.名称:                           eth0
GENERAL.UUID:                           8071cc7b-d407-4dea-a41e-16f7d2e75ee9
GENERAL.设备:                           ens33
GENERAL.状态:                           已激活
GENERAL.默认:                           是
GENERAL.DEFAULT6:                       否
GENERAL.VPN:                            否
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/0
GENERAL.SPEC 对象:                      --
GENERAL.MASTER-PATH:                    --
IP4.地址[1]:                            ip = 192.168.1.128/24, gw = 192.168.1.1
IP4.DNS[1]:                             8.8.8.8
IP4.DNS[2]:                             8.8.4.4
IP6.地址[1]:                            ip = fe80::20c:29ff:fe25:cdbf/64, gw = ::
[root@sky ~]#

 

[root@sky ~]# cd /etc/sysconfig/

[root@sky sysconfig]# cat grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,,g‘ /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root crashkernel=auto  rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 net.ifnames=0 biosdevname=0 vconsole.keymap=us rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
[root@sky sysconfig]# grub2-mkconfig -o /boot/grub2/grub.cfg

Redhat7 network

标签:

原文地址:http://www.cnblogs.com/skyfly0772/p/5003572.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!