若荐絎 Linuxラ膩

maya
篁ャLinux泣若 若荐絎 ゃ荅宴

 

 

若荐絎

maya
若ゃ茯篁絎荐絎帥帥篁ヤ若罕茯蚊若сゃ≪鴻IP≪鴻医c違ф絵

 

 

篋羣

maya
VirtualBox篏帥劫鴻筝羣茵篋冴篋羣茯翠違

 

1. VirtualBox莎桁絲乗院蚊鴻OS御

2. 荐絎 > 若 > ≪帥4

3. 若≪帥若劫сャ

4. 蚊綵若御

5. OK

 

nao

maya
違ゃ鴻篏帥荐絎篁篏帥c若≪帥若ゃ紊眼ゃ潟帥若膵c違鴻篏

nao
鐚鐚鐚

maya
VirtualBox篁潟激鴻сャ純潟潟LAN宴若冴若違1よ申荐絎違

 

nmcli 潟潟

nao
ゃ[guest]с違ゃ潟帥若莎桁

 

[guest@localhost ~]$

 

maya
篁nmcli潟潟篏帥CentOS7сCentOS6篁ュ鴻違ф絵

nao
CentOS6CentOS7潟潟違鐚

maya
若荐絎篁緇膣剛泣若壕儀ゃ篁障с紊с違cсц帥鴻若吾с潟羈

nao

maya
篁篏鴻膊∞罔у純nmcli潟潟絨cс障help腆肴

 

[root@localhost ~]# nmcli help
篏帥: nmcli [OPTIONS] OBJECT { COMMAND | help }

OPTIONS
  -t[erse]                                       terse output
  -p[retty]                                      pretty output
  -m[ode] tabular|multiline                      output mode
  -c[olors] auto|yes|no                          whether to use colors in output
  -f[ields] <field1,field2,...>|all|common       specify fields to output
  -g[et-values] <field1,field2,...>|all|common   shortcut for -m tabular -t -f
  -e[scape] yes|no                               escape columns separators in values
  -a[sk]                                         ask for missing parameters
  -s[how-secrets]                                allow displaying passwords
  -w[ait]                               set timeout waiting for finishing operations
  -v[ersion]                                     show program version
  -h[elp]                                        print this help

OBJECT
  g[eneral]       NetworkManager's general status and operations
  n[etworking]    overall networking control
  r[adio]         NetworkManager radio switches
  c[onnection]    NetworkManager's connections
  d[evice]        devices managed by NetworkManager
  a[gent]         NetworkManager secret agent or polkit agent
  m[onitor]       monitor NetworkManager changes
maya
眼nmcli “OBJECT” helpnmcli “OBJECT” “COMMAND” help篏帥с篏帥鴻c”help”帥

 

鴻荐絎

maya
c鴻紊眼茵

 

1. 憜鴻腆肴

[root@localhost ~]# nmcli g hostname
localhost.localdomain

 

maya
荐絎鴻localhostс<ゃ喝localdomain

nao
localhostcц

 

2. 鴻紊眼

[root@localhost ~]# nmcli g hostname centos7.localdomain

 

3. 紊翫絎鴻腆肴

[root@localhost ~]# nmcli g hostname
centos7.localdomain

 

maya
篁localhostcentos7紊眼

nao
localhostc潟潟ゃ潟root@localhost ~localhost筝膩鐚

maya
Linux泣若莎桁紊眼сc帥

 

4. 莎桁

[root@localhost ~]# shutdown -r now

 

5. 莎桁緇帥若莎桁

[guest@centos7 ~]$

 

nao
茵荐紊c

maya
с帥若莎桁潟潟ゃ潟鴻茹cсc

nao
c若九@鴻 潟c鐚

maya
綽<c鴻若銀c篏荀帥

 

IP≪鴻荐絎

maya
障ゃ鴻腆肴茵

 

1. nmcli潟潟ф・膓倶腆肴茵

[root@centos7 ~]# nmcli d
ゃ  帥ゃ    倶      ・膓       
enp0s8    ethernet  ・膓羝  膩・膓 1 
enp0s10   ethernet  羝  --         
enp0s3    ethernet  羝  --         
lo        loopback  膊∞<  --

 

maya
篁ゃ鴻enp0s10篁ヤ荐絎茵若医紊眼

 

IPv4≪ 172.16.32.100/24
蚊若с 172.16.32.1

 

maya
障ゃ鴻enp0s10菴遵

 

1. ゃ鴻憟句∈茯茵

[root@centos7 ~]#  nmcli d show enp0s10
GENERAL.ゃ:                       enp0s10
GENERAL.帥ゃ:                         ethernet
GENERAL.若с≪≪:           08:00:27:57:CB:1A
GENERAL.MTU:                            1500
GENERAL.倶:                           30 (羝)
GENERAL.・膓:                           --
GENERAL.CON :                       --
WIRED-PROPERTIES.c:              

 

2. ゃ鴻菴遵荐絎茵

[root@centos7 ~]# nmcli d add type ethernet ifname enp0s10 con-name enp0s10
・膓 'enp0s10' (************************) 罩e幻菴遵障

 

3. 腆肴

[root@centos7 ~]# nmcli d
ゃ  帥ゃ    倶                       ・膓       
enp0s8    ethernet  ・膓羝                   膩・膓 1 
enp0s10   ethernet  ・膓筝鐚IP 荐絎緇筝鐚  膩・膓 2 
enp0s3    ethernet  羝                   --         
lo        loopback  膊∞<                   --

 

maya
膓IPv4≪鴻蚊若сゃ≪鴻荐絎

 

1. IPv4≪鴻荐絎

[root@centos7 ~]# nmcli c modify enp0s10 ipav4.addresses 172.16.32.100/24

 

2. 蚊若сゃ≪鴻荐絎

[root@localhost ~]# nmcli c modify enp0s10 ipv4.gateway 172.16.32.1

 

maya
緇荐絎絎鴻鴻ゃ鴻莎桁

 

1. ゃ鴻罩≪

[root@centos7 ~]# nmcli c down enp0s10
・膓 'enp0s10' 罩e幻≪c障 (D-Bus ≪c: /org/freedesktop/NetworkManager/ActiveConnection/14)

 

2. ゃ鴻莎桁

[root@centos7 ~]# nmcli c up enp0s10
・膓罩e幻≪c若障 (D-Bus ≪c: /org/freedesktop/NetworkManager/ActiveConnection/15)

 

maya
緇荐絎絎鴻腆肴

 

1. ゃ鴻腆肴茵

[root@centos7 ~]# nmcli d show enp0s10
GENERAL.ゃ:                       enp0s10
GENERAL.帥ゃ:                         ethernet
GENERAL.若с≪≪:           **:**:**:**:**:**:**
GENERAL.MTU:                            1500
GENERAL.倶:                           100 (・膓羝)
GENERAL.・膓:                           enp0s10
GENERAL.CON :                       /org/freedesktop/NetworkManager/ActiveConnection/15
WIRED-PROPERTIES.c:              
IP4.≪[1]:                        172.16.32.100/24
IP4.蚊若с:                       172.16.32.1
IP6.≪[1]:                        fe80::****:****:****:****/64
IP6.蚊若с:                       --

 

2. ・膓倶腆肴茵

[root@centos7 ~]# nmcli d
ゃ  帥ゃ    倶      ・膓
enp0s10   ethernet  ・膓羝  enp0s10
enp0s8    ethernet  ・膓羝  膩・膓 1
enp0s3    ethernet  羝  --
lo        loopback  膊∞<  --

 

maya
篁荐絎障т箴DNSIPv6荐絎nmcli潟潟у純сц帥障

nao
篁腱糸眼絨c

 

  • nmcli潟潟с鴻IP≪鴻荐絎茵
  • 荐絎絨c”help”羇紫
  • CentOS6篁ュ荐絎違

 

鐚鐚若祉鐚鐚