网络配置是Linux系统配置非常重要的一步,网络配置一般分为两类:静态ip配置以及dhcp配置,这两种配置在debain和RedHat系统中略有不同。因为没有深入学习过Linux操作系统,不是很了解Debain系和RedHat系的区别的本质,所以我仅从结论上进行阐述。
假设有这样一个环境,Linux主机有两张网卡,分别是10.10.10.0/24网段和192.168.10.0/24网段,
Ubuntu中的系统网络配置
网卡的dhcp配置:
首先使用ifconfig查看网卡状况
(这里只识别到了一张网卡应该是虚拟机的原因,正常应该是可以识别到两张网卡的。识别到的网卡默认是使用dhcp获得IP地址的)
对网卡进行编辑
sudo vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5)
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interfac