겉바속촉

[DOCKER] 도커_Network static하게 설정하기 본문

IT 일기 (상반기)/DOCKER

[DOCKER] 도커_Network static하게 설정하기

겉바속촉 2020. 12. 31. 13:13
728x90
반응형

 

DOCKER에 대해서

 

공부해보도록 하겠습니다

 

!^^!

 

 

 


 

 

Network static하게 설정하기

 

 

root@centos-docker:network-scripts]

$ vi /etc/sysconfig/network-scripts/ifcfg-ens33 

BOOTPROTO="none"

IPADDR=192.168.75.128

PREFIX=24

GATEWAY=192.168.75.2

DNS1=192.168.75.2



root@centos-docker:network-scripts]

$ systemctl restart network

-----------------------------------------------------------------------------------------

 

 

/etc/network/interfaces (ubuntu16.04이하)

 

 

root@ubuntu-docker:/etc/netplan# vi 00-installer-config.yaml  (ubuntu18.04이상)

# This is the network config written by 'subiquity'

network:

  ethernets:

    ens33:

            addresses: [192.168.75.129/24]

            gateway4: 192.168.75.2

            nameservers:

              addresses: [192.168.75.2,8.8.8.8]

            dhcp4: no    #<--ture를 no로 바꿔주기

  version: 2

root@ubuntu-docker:/etc/netplan# netplan apply

ip a  (확인)

 

728x90
반응형