LoginSignup
0
0

More than 5 years have passed since last update.

NetworkMangager備忘録

Last updated at Posted at 2018-08-10

素のCentOS7だと以下のような変更しないとアレだったのでデバイス名変える方法について備忘録を。

  • 固定にする場合
vi /etc/default/grub
GRUB_CMDLINE_LINの行に net.ifnames=0 biosdevname=0 を追加
ls /etc/udev/rules.d/
##以下があったら削除(なかった)
    - 60-net.rules
    - 71-biosdevname.rules
    - 75-net-description.rules
    - 80-net-name-slot.rules

# nmcli --fields NAME con show
名前   
ens160 
nmcli connection modify "ens160" connection.id "eth0" 
nmcli connection modify "eth0" connection.interface-name "eth0" 
nmcli connection modify "eth0" ipv4.address "10.5.0.136/21" ipv4.gateway "10.5.0.1" 
nmcli connection modify "eth0" ipv4.method manual
nmcli connection show "eth0" 
nmcli connection modify "eth0" ipv6.method ignore
sed -i 's/ens160/eth0/g' /etc/sysconfig/network-scripts/ifcfg-ens160 
mv /etc/sysconfig/network-scripts/ifcfg-{ens160,eth0}
vi /etc/sysconfig/network-scripts/ifcfg-eth0
PEERDNS=no ## ついか
IPV6INIT=no ## これ以外のV6の行をけす
HWADDR=02:01:16:9C:00:53をip addr showでみてついか
reboot
  • dhcpでipv4.methodはautoのままでdns設定を書き換える挙動を抑制したい場合
nmcli con mod eth0 ipv4.ignore-auto-dns yes
nmcli con mod eth0 ipv6.ignore-auto-dns yes
nmcli con mod eth0 
nmcli con mod eth0 ipv4.dns 8.8.8.8
systemctl restart NetworkManager
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0