ubuntu 18.04 Static IP 설정

 

 

ip 및 route 확인

root@test:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.146  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe21:fa45  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:21:fa:45  txqueuelen 1000  (Ethernet)
        RX packets 1081  bytes 1090726 (1.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 462  bytes 55353 (55.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 220  bytes 17184 (17.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 220  bytes 17184 (17.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


root@test:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.2     0.0.0.0         UG    100    0        0 ens33
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
192.168.0.2     0.0.0.0         255.255.255.255 UH    100    0        0 ens33
root@test:~#

 

ens33 device 설정

dhcp 사용시
root@test:~# cat /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens33:
            addresses: []
            dhcp4: true
    version: 2

static ip 사용시
root@test:~# vi /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens33:
            dhcp4: no
            addresses: [192.168.0.100/24]
            gateway4: 192.168.0.2
            nameservers:
              addresses: [8.8.8.8,1.1.1.1]
    version: 2
root@test:~# netplan apply
root@test:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe21:fa45  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:21:fa:45  txqueuelen 1000  (Ethernet)
        RX packets 3349  bytes 1293093 (1.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2521  bytes 446805 (446.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 224  bytes 17428 (17.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 224  bytes 17428 (17.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@test:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.2     0.0.0.0         UG    0      0        0 ens33
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
root@test:~# ping kr.yahoo.com
PING src.san1.g01.yahoodns.net (106.10.248.151) 56(84) bytes of data.
64 bytes from w2.src1.vip.sg3.yahoo.com (106.10.248.151): icmp_seq=1 ttl=128 time=89.9 ms
64 bytes from w2.src1.vip.sg3.yahoo.com (106.10.248.151): icmp_seq=2 ttl=128 time=93.0 ms
^C
--- src.san1.g01.yahoodns.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 89.954/91.490/93.027/1.565 ms
root@test:~#

 

xfce install

 

 

xfce 패키지를 설치 합니다.

[root@centos7 ~]# yum install epel-release -y
[root@centos7 ~]# yum groupinstall "Server with GUI" -y
[root@centos7 ~]# yum groupinstall "Xfce" -y
[root@centos7 ~]# systemctl set-default graphical.target

 

로그인 할 id 를 입력후 password 입력시 아래와 같이 로그인을 xfce 로 지정 합니다.

 

xfce 설치를 완료하였습니다.

노트북에서 Linux Desktop 을 사용할 일이 종종 있습니다.

pxe 를 쓴다 던지 Cluster ssh 를 쓴다 던지.. 그럴때 마다 Touchpad 부분 때문에 오타가 자주 납니다.

예전에는 synclient 로 사용 했었는데.. CentOS7 에서는 잠깐 꺼졌다가 다시 터치패드가 활성화 됩니다.

xinput list 로 id 를 확인 한후 Device 의 활성 / 비활성을 설정 할수 있습니다.

.bashrc 파일에 alias 로 touchoff / touchon 으로 설정 하여 사용하시면 편합니다.

 

[root@sanjuk-desktop ~]# synclient TouchpadOff=1
[root@sanjuk-desktop ~]# synclient TouchpadOff=0
[root@sanjuk-desktop ~]# xinput list
⎡ Virtual core pointer                      id=2  [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4  [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=10  [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=11  [slave  pointer  (2)]
⎜   ↳   USB Keyboard                            id=13  [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech TrackPoint                id=16  [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=17  [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3  [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5  [slave  keyboard (3)]
    ↳ Power Button                              id=6  [slave  keyboard (3)]
    ↳ Video Bus                                 id=7  [slave  keyboard (3)]
    ↳ Sleep Button                              id=8  [slave  keyboard (3)]
    ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=9  [slave  keyboard (3)]
    ↳   USB Keyboard                            id=12  [slave  keyboard (3)]
    ↳ Integrated Camera                         id=14  [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=15  [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=18  [slave  keyboard (3)]
[root@sanjuk-desktop ~]# xinput set-prop 17 "Device Enabled" 0
[root@sanjuk-desktop ~]# xinput set-prop 17 "Device Enabled" 1