使用ssh服務管理遠程主機

創建網絡會話
[root@linuxprobe ~]# nmcli connection show
NAME UUID TYPE DEVICE
eno16777736 ec77579b-2ced-481f-9c09-f562b321e268 802-3-ethernet eno16777736
[root@linuxprobe ~]# nmcli con show eno16777736
connection.id: eno16777736
connection.uuid: ec77579b-2ced-481f-9c09-f562b321e268
connection.interface-name: --
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.timestamp: 1487348994
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
使用con-name參數指定公司所使用的網絡會話名稱company
[root@linuxprobe ~]# nmcli connection add con-name company ifname eno16777736 autoconnect no type ethernet ip4 192.168.10.10/24 gw4 192.168.10.1
Connection 'company' (86c71220-0057-419e-b615-38f4014cfdee) successfully added.
使用con-name參數指定家庭所使用的網絡會話名稱house
[root@linuxprobe ~]# nmcli connection add con-name house type ethernet ifname eno16777736
Connection 'house' (44acf0a7-07e2-40b4-94ba-69ea973090fb) successfully added.
啓用house網絡會話
[root@linuxprobe ~]# nmcli connection up house
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
[root@linuxprobe ~]# ifconfig
eno1677773628: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.100.128 netmask 255.255.255.0 broadcast 192.168.100.255
inet6 fe80::20c:29ff:fec4:a409 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c4:a4:09 txqueuelen 1000 (Ethernet)
RX packets 42 bytes 4198 (4.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 75 bytes 10441 (10.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 518 bytes 44080 (43.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 518 bytes 44080 (43.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章