๐ŸงLinux - LAN ํด๋Ÿฌ์Šคํ„ฐ

2531 ๋‹จ์–ด bashlinuxcluster

์ „์ œ



์ด ๊ฐ€์ด๋“œ์—์„œ๋Š” Linux ์žฅ์น˜๋งŒ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ์Šฌ๋ ˆ์ด๋ธŒ/๋งˆ์Šคํ„ฐ ์„œ๋ฒ„ ๊ตฌ์„ฑ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๋งˆ์Šคํ„ฐ์— ์ ํ•ฉํ•œ ๋ชจ๋“  ์žฅ์น˜๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ๋‘ ๊ฐœ์˜ ์ด๋”๋„ท ํฌํŠธ๊ฐ€ ์žˆ๋Š” ์ผ๋ฐ˜ HP Pavilion 15 ๋…ธํŠธ๋ถ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์Šฌ๋ ˆ์ด๋ธŒ๋กœ์„œ ์ผ๋ฐ˜ HP 250 G6 ๋…ธํŠธ๋ถ๊ณผ E402MA(ASUS-NotebookSKU)๋ฅผ ์‚ฌ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋‘˜ ๋‹ค ๋…ธํŠธ๋ถ์ž…๋‹ˆ๋‹ค.

์ด๋”๋„ท ์ผ€์ด๋ธ”์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ๋ฅผ ๋งˆ์Šคํ„ฐ์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

PC๋Š” ์„œ๋ฒ„๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๊ฒƒ์ด ์•„๋‹ˆ๋ผ๋Š” ์ ์„ ์–ธ๊ธ‰ํ•  ๊ฐ€์น˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
๋‚˜์œ ์„ฑ๋Šฅ/์—๋„ˆ์ง€ ์†Œ๋น„.

์š”๊ตฌ ์‚ฌํ•ญ


  • ์ตœ์†Œ 2๊ฐœ์˜ ์ด๋”๋„ท ํฌํŠธ๊ฐ€ ์žˆ๋Š” Linux ์žฅ์น˜ 1๊ฐœ
  • ๊ฐ๊ฐ ์ตœ์†Œ 1๊ฐœ์˜ ์ด๋”๋„ท ํฌํŠธ๊ฐ€ ์žˆ๋Š” 1๊ฐœ ์ด์ƒ์˜ Linux ์žฅ์น˜(์Šฌ๋ ˆ์ด๋ธŒ)
  • ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ์šฉ ์ด๋”๋„ท ์ผ€์ด๋ธ” 1๊ฐœ

  • ๊ฐ ์žฅ์น˜์— ์„ค์น˜๋œ DHCPCD ํด๋ผ์ด์–ธํŠธ

  • ๋…ธ์˜ˆ



    ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ DHCPCD๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.$ apt install dhcpcd5๋˜๋Š”$ apt install dhcpcd
    ํŽธ์ง‘ DHCPCD์˜ ๊ตฌ์„ฑ ํŒŒ์ผ(์ผ๋ฐ˜์ ์œผ๋กœ /etc/dhcpcd.conf)์„ ํŽธ์ง‘ํ•˜๊ณ  ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ์˜ ์ด๋”๋„ท ์ธํ„ฐํŽ˜์ด์Šค์— ์ •์  IP๋ฅผ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค. ์ œ ๊ฒฝ์šฐ ์ธํ„ฐํŽ˜์ด์Šค ์ด๋ฆ„์€ eno1์ž…๋‹ˆ๋‹ค. ๋‹ค์Œ ์ค„์„ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    (HP 250 G6 ๋…ธํŠธ๋ถ)interface eno1static ip_address=10.0.99.2
    [E402MA(ASUS-NotebookSKU)]interface eno1static ip_address=10.0.98.2
    ๋“ฑ๋“ฑ.

    ์ฃผ์ธ


    ์‚ฌ์šฉ์ž ๊ณต๊ฐ„ /dev



    udev์— ์ƒˆ๋กœ์šด ๊ทœ์น™ ์„ธํŠธ๋ฅผ ์ถ”๊ฐ€ํ•  ๊ฐ€์น˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒˆ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ณ  ์ด๋ฆ„์„ 60-homecluster.rules๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.$ touch /etc/udev/rules.d/60-homecluster.rules
    ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ MAC ์ฃผ์†Œ ๊ฐ€์ ธ์˜ค๊ธฐ: ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ ์„œ๋ฒ„์—์„œ ifconfig ๋˜๋Š” cat /sys/class/net/${INTERFACE}/address๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธํ„ฐํŽ˜์ด์Šค MAC์„ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด:
    $ cat /sys/class/net/eno1/address
    ์ด ์˜ˆ์—์„œ ๋งˆ์Šคํ„ฐ์—๋Š” ๋‘ ๊ฐœ์˜ ์ด๋”๋„ท ์ธํ„ฐํŽ˜์ด์Šค์ธ eth1๊ณผ eth2๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
    ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ ์žฅ์น˜ MAC์„ ๋งคํ•‘ํ•ฉ๋‹ˆ๋‹ค.
    DEVICE_MAC์„ ๊ฒ€์ƒ‰ํ•œ MAC ์ฃผ์†Œ๋กœ ๊ต์ฒดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    HP 250 G6 ๋…ธํŠธ๋ถ์˜ ๊ฒฝ์šฐSUBSYSTEM=="net", ATTR{address}=="DEVICE_MAC", NAME="eth1"
    E402MA(ASUS-NotebookSKU)์˜ ๊ฒฝ์šฐ
    SUBSYSTEM=="net", ATTR{address}=="DEVICE_MAC", NAME="eth2"
    ๋“ฑ๋“ฑ.

    60-homecluster.rules๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    SUBSYSTEM=="net", ATTR{address}=="f4:30:b9:52:55:78", NAME="eth1"
    SUBSYSTEM=="net", ATTR{address}=="10:f0:05:ce:87:28", NAME="eth2"
    


    DHCP



    ์ผ๋ฐ˜์ ์œผ๋กœ DHCPCD์˜ ๊ตฌ์„ฑ ํŒŒ์ผ/etc/dhcpcd.conf์„ ํŽธ์ง‘ํ•˜๊ณ  ๊ฐ ์Šฌ๋ ˆ์ด๋ธŒ์— ๋กœ์ปฌ IP ๋ธ”๋ก์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค.

    interface eth1
    static ip_address=10.0.99.1/24
    
    interface eth2
    static ip_address=10.0.98.1/24
    


    ๋งˆ์ง€๋ง‰์œผ๋กœ ๊ฐ ์ด๋”๋„ท ์ผ€์ด๋ธ”์„ ์—ฐ๊ฒฐํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  DHCPCD๋ฅผ ๋‹ค์‹œ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.$ dhcpcd -k
    ๋ช‡ ์ดˆ ์ด์ƒ ๊ธฐ๋‹ค๋ฆฌ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.$ dhcpcd
    SSH๋กœ ์—ฐ๊ฒฐ ์‹œ๋„$ ssh [email protected]$ ssh [email protected]

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ