ubuntu18 查看物理网卡
sudo lshw -class network
ip link show
lspci | grep -i ethernet
开启网卡:
sudo ifconfig enp3s0 up
KVM网卡配制
<interface type=”direct”>
<mac address=”52:54:00:9c:17:0d”/>
<source dev=”enp3s0″ mode=”bridge”/>
<target dev=”macvtap0″/>
<model type=”e1000e”/>
<alias name=”net0″/>
<address type=”pci” domain=”0x0000″ bus=”0x09″ slot=”0x00″ function=”0x0″/>
</interface>
主机网络配制参考
root@igserver:~/桌面# ifconfig -a
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.24.30 netmask 255.255.255.0 broadcast 192.168.24.255
ether d4:5d:64:aa:75:d4 txqueuelen 1000 (以太网)
RX packets 3135521 bytes 189430298 (189.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15647655 bytes 21722337367 (21.7 GB)
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 (本地环回)
RX packets 333 bytes 30964 (30.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 333 bytes 30964 (30.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
macvtap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::5054:ff:fe9c:170d prefixlen 64 scopeid 0x20<link>
ether 52:54:00:9c:17:0d txqueuelen 500 (以太网)
RX packets 1249 bytes 126371 (126.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 371 bytes 30313 (30.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.100.1 netmask 255.255.255.0 broadcast 192.168.100.255
ether 52:54:00:a0:fc:24 txqueuelen 1000 (以太网)
RX packets 1402 bytes 40940 (40.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 732 (732.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Ubuntu18.04默认可能没有安装traceroute。要安装它,请打开终端并输入以下命令:
sudo apt update sudo apt install traceroute
安装完成后,使用traceroute非常简单。在终端中输入以下命令:
traceroute example.com
# 首先检查目前防火墙是否已经开启,执行以下指令:
sudo ufw status
# 防火墙默认是关闭,会输出:
# Status:inactive
#如果防火墙已经开启了,会输出active:
# Status: active
#如果需要关两防火墙,执行以下指令:
# Disabling the Firewall
sudo ufw disable
# Firewall stopped and disabled on system startup
#关湖防火墙后,要再次开启防火墙,执行以下指令开启:sudo ufw enable
# 这时会出现以下海问句:# Command may disrupt existing ssh connections. Proceed with operation (yn)?#按“y”确认后,防火墙会开启,并有以下输出:
# Firewall is active and enabled on system startup