* 문제 현상

ubuntu Booting시 ethernet이 잡혀있지 않고, gateway default가 없어서 내부,외부망 모두 ping test 안됨.

$ ifconfig enp3s0 192.168.10.201 

  내부망 가능, 외부망 불가

$ route add default gw 192.168.10.1

  내부망, 외부망 가능  

 

* 부팅시 적용 시키기 위한 작업

 

 

1. New Netplan setup - netplan: fatal error: cannot bind to port 2983, is another daemon 문제

 

기존에는 systemd에 의해 netplan 사용하여 ethernet이 적용됨

 

$ vi /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
        version: 2
        ethernets:
                enp0s3:
                  addresses: [192.168.10.201/24]
                  dhcp4: no
                  dhcp6: no
                  gateway4: 192.168.10.1
                  nameservers:
                    addresses: [8.8.8.8, 8.8.4.4]

$ netplan apply정상일 경우 적용됨.

 

 * New Netplan setup - netplan: fatal error: cannot bind to port 2983, is another daemon 문재 나왔을 경우

 

$ sudo apt install netplan.io netplan-

error는 없어 졌지만, netplan이 적용되지 않음.

 

 * system를 등록하여 스크립트 적용하여 해결하였음.

$ vi /etc/systemd/system/startup.service

[Unit]
Description= Apply Static IP 192.168.10.201

[Service]
Type=simple
ExecStart=/etc/startup_ip.sh

[Install]
WantedBy=multi-user.target

 

$ vi /etc/startup_ip.sh

#!/bin/sh

ifconfig enp3s0 192.168.10.201
route add default gw 192.168.10.1

$ chmod +x /etc/startup_ip.sh

$ sudo systemctl enable startup

 

<참고>

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=sslife301&logNo=221359095960

'Linux' 카테고리의 다른 글

DNS Server 추가  (0) 2021.12.20
[Pakage Error] Could not get lock /var/lib/dpkg/lock-frontend  (0) 2021.12.05
커널 메세지 출력(printk log level) 분석  (0) 2021.11.02
ubuntu Samba 설정  (0) 2021.07.30
ext4 mount하여 파일 확인 방법  (0) 2021.07.26

+ Recent posts