고정IP

Published by onesixx on

 

현재 IP 현황 파악

⇒ ifconfig
enp2s0    Link encap:Ethernet  HWaddr 6c:62:6d:05:fb:9b  
          inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7159:5ee7:8476:35eb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:89822 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73308 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:70998915 (70.9 MB)  TX bytes:9511085 (9.5 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3278 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:419365 (419.3 KB)  TX bytes:419365 (419.3 KB)

wlp4s0    Link encap:Ethernet  HWaddr 00:26:82:6b:a9:02  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 Gateway는 192.168.1.1

⇒ ip route
default via 192.168.1.1 dev enp2s0 proto static metric 100 
192.168.1.0/24 dev enp2s0 proto kernel scope link src 192.168.1.6 metric 100

 

 

System Setting> Network

현재 설정 – 유동IP

sudo vi /etc/network/interfaces

Default: 원본

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

 

고정 IP로 수정

/etc/network/interfaces 파일을 수정한다. 
(eth0는 네크웍 카드를 지칭함.)

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# The primary network interface
# auto eth0
# iface eth0 inet dhcp

# manual
auto eth0
iface eth0 inet static
address 192.168.1.6
netmask 255.255.255.0
netwrok 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.1

dns-nameservers 8.8.8.8 8.8.4.4 164.124.101.2 203.248.252.2 208.67.222.222 208.67.220.220

 적용을 위해 Network restart

⇒ sudo systemctl restart networking.service
⇒ sudo systemctl status networking.service 

 

 

 

http://webdir.tistory.com/188

DNS 직접수정

/etc/resolv.conf 을 수정하면 안된다.  

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search RT-DHCP

/etc/resolvconf/resolv.conf.d/head 

  • base – 다른 설정 파일들을 찾을수 없을때 사용된다.
  • head – resolv.conf 파일의 헤더에 사용되는 DNS 서버는 항상 목록의 첫 번째인지 확인하는데 사용할 수 있다.

공유기의 WAN :  현재는 자동으로 잡아두었다. 

공유기의 LAN

DNS 정보

https://developers.google.com/speed/public-dns/docs/using

168.126.63.1 168.126.63.2 

Google Public DNS

기본 : 8.8.8.8
보조 : 8.8.4.4

한국통신(KT) DNS

기본 : 168.126.63.1
보조 : 168.126.63.2

선경통신(SKB) DNS

기본 : 219.250.36.130
보조 : 210.220.163.82

락희금성통신 (LG U+) DNS

기본 : 164.124.101.2
보조 : 203.248.252.2

Open DNS

기본 : 208.67.222.222
보조 : 208.67.220.220

Categories: Ubuntu

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x