Categories
linux rangkaian

IP Statik

  1. Sebagai pengguna root, pasang resolvconf
    # apt-get install resolvconf
  2. Periksa port yang ada
    # ifconfig -a
    eth1 Link encap:Ethernet HWaddr 00:0c:29:47:ac:f0
    inet addr:172.16.234.100 Bcast:172.16.234.255 Mask:255.255.255.0
    inet6 addr: fe80::20c:29ff:fe47:acf0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:4498 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3871 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:503062 (503.0 KB) TX bytes:477625 (477.6 KB)

    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:16436 Metric:1
    RX packets:123 errors:0 dropped:0 overruns:0 frame:0
    TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:11554 (11.5 KB) TX bytes:11554 (11.5 KB)

  3. Biasanya port RJ45 bermula dengan eth. Guna mii-tool untuk memeriksa sambungan
    # mii-tool eth1
    eth1: negotiated 1000baseT-FD flow-control, link ok
  4. Edit /etc/network/interfaces
    [code lang=”plain”]auto lo
    iface lo inet loopback

    auto eth1
    iface eth1 inet static
    address 172.16.234.100
    netmask 255.255.255.0
    gateway 172.16.234.1
    dns-nameservers 8.8.8.8[/code]

  5. Mulakan semula servis rangkaian
    # /etc/init.d/networking restart