๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿง์šด์˜์ฒด์ œ/๋ฆฌ๋ˆ…์Šค

๋ฆฌ๋ˆ…์Šค - ์•„์ดํ”ผ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•(/etc/network/interfaces)

by Janger 2023. 10. 31.
728x90
๋ฐ˜์‘ํ˜•

 

์˜ˆ์‹œ) ์‚ฌ์„ค ์•„์ดํ”ผ 192.168.57.10์„ 192.168.57.30์œผ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  ์‹ถ์„ ๊ฒฝ์šฐ

 

ํŽธ์ง‘๊ธฐ(vi, nano)๋กœ /etc/network/interfaces ์—ด๊ธฐ
nano /etc/network/interfaces

 

์ˆ˜์ • ์ „ /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
 address 192.168.57.10
 network 192.168.57.0
 netmask 255.255.255.0
 gateway 192.168.57.2

 

์ˆ˜์ • ํ›„ /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
 address 192.168.57.30
 network 192.168.57.0
 netmask 255.255.255.0
 gateway 192.168.57.2

 

๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ ๋ฐ๋ชฌ ์žฌ์‹œ์ž‘
service networking restart

 

์•„์ดํ”ผ ํ™•์ธ(ifconfig)
ifconfig

 

root@kali:~/Desktop# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:da:0d:23  
          inet addr:192.168.57.30  Bcast:192.168.57.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feda:d23/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:276 (276.0 B)  TX bytes:2774 (2.7 KiB)

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:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1036 (1.0 KiB)  TX bytes:1036 (1.0 KiB)

 

728x90
๋ฐ˜์‘ํ˜•