- CentOS 版本:CentOS-7-x86_64-DVD-1804.iso
ifconfig 命令問題
[root@localhost ~]# ifconfig
-bash: ifconfig: command not found
若 CentOS 里邊是沒有安裝 ifconfig
解決辦法:yum安裝ifconfig這個(gè)命令包
# 需要保證虛擬機(jī)能連接外網(wǎng)
yum search ifconfig
yum install net-tools.x86_64
通信問題
NAT | Bridged Adapter | Internal | Host-only Adapter | |
---|---|---|---|---|
虛擬機(jī)->主機(jī) | ?? | ?? | ? | 默認(rèn)不需要設(shè)置 |
主機(jī)->虛擬機(jī) | ? | ?? | ? | 默認(rèn)不需要設(shè)置 |
虛擬機(jī)->其他主機(jī) | ?? | ?? | ? | 默認(rèn)不需要設(shè)置 |
其他主機(jī)->虛擬機(jī) | ? | ?? | ? | 默認(rèn)不需要設(shè)置 |
虛擬機(jī)之間 | ? | ?? | 同網(wǎng)絡(luò)名下可以 | ?? |
需要的條件:主機(jī)能 ssh 連接虛擬機(jī),虛擬機(jī)能連接外網(wǎng)
- 網(wǎng)卡1:橋接網(wǎng)絡(luò)
- 網(wǎng)卡2:網(wǎng)絡(luò)地址轉(zhuǎn)換(NAT)
[root@localhost ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.119 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::8aae:e52f:c521:efb prefixlen 64 scopeid 0x20<link>
ether 08:00:27:67:bd:5c txqueuelen 1000 (Ethernet)
RX packets 140 bytes 13812 (13.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100 bytes 11757 (11.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.3.15 netmask 255.255.255.0 broadcast 10.0.3.255
inet6 fe80::8c29:2c4a:8682:b9f5 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:06:46:d4 txqueuelen 1000 (Ethernet)
RX packets 4 bytes 814 (814.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1400 (1.3 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 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0