## CentOS 6.9 eth setting
** "cat /etc/sysconfig/network-scripts/ifcfg-eth0"
DEVICE=eth0
HWADDR=00:30:18:00:e1:65
TYPE=Ethernet
UUID=87093b7d-de84-4418-bbdd-a49f21a0be9d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no
IPADDR=10.10.8.190
GATEWAY=10.10.8.254
NETMASK=255.255.255.0
DNS1=10.10.0.9
DNS2=10.10.0.10
## DNS 設定
/etc/hosts :這個是最早的 hostname 對應 IP 的檔案;
/etc/resolv.conf :這個重要!就是 ISP 的 DNS 伺服器 IP 記錄處;
/etc/nsswitch.conf:這個檔案則是在『決定』先要使用 /etc/hosts 還是 /etc/resolv.conf 的設定!
"vim /etc/resolv.conf"
nameserver 168.95.1.1
nameserver 139.175.10.20
## CentOS 新增網卡
**找出目前所有網卡
dmesg | grep -in eth
387:[ 2.074571] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 08:00:27:37:d5:5a
388:[ 2.074587] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
412:[ 2.571363] e1000 0000:00:08.0 eth1: (PCI:33MHz:32-bit) 08:00:27:03:28:44
413:[ 2.571371] e1000 0000:00:08.0 eth1: Intel(R) PRO/1000 Network Connection
417:[ 2.588359] systemd-udevd[244]: renamed network interface eth1 to enp0s8
420:[ 2.597290] systemd-udevd[241]: renamed network interface eth0 to enp0s3
**找出新網卡 mac address
ifconfig
enp0s3: flags=4163 mtu 1500
inet 192.168.56.101 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::a00:27ff:fe37:d55a prefixlen 64 scopeid 0x20
ether 08:00:27:37:d5:5a txqueuelen 1000 (Ethernet)
RX packets 6911 bytes 3960745 (3.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6048 bytes 1263062 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
**產生新網卡的 UUID
# uuidgen enp0s8
297daa1e-a83d-471e-b70d-83eafb2f2470
**產生新網卡的 eth-scripts
cd /etc/sysconfig/network-scripts/
# cp ifcfg-enp0s3 ifcfg-enp0s8
AME、UUID、DEVICE、HWADDR修改為新網卡資料
# vi ifcfg-enp0s8
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s8
UUID=297daa1e-a83d-471e-b70d-83eafb2f2470
DEVICE=enp0s8
HWADDR=08:00:27:03:28:44
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
沒有留言:
張貼留言