Linux2009.08.10 13:28
SYNOPSIS
       ifconfig [interface]
       ifconfig interface [aftype] options | address ...

       [-]broadcast [addr]
              If  the  address argument is given, set the protocol broadcast address for this interface.  Otherwise, set
              (or clear) the IFF_BROADCAST flag for the interface.

ifconfig에서 보면은
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:123.45.67.8  Bcast:123.45.127.255  Mask:255.255.192.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8829 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:607276 (593.0 KiB)  TX bytes:1480 (1.4 KiB)
          Interrupt:133

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
위와 같이 나오는데 Bcast라는 항목이 존재한다.
물론 ifconfig에서 설정을 해줄 수도 있지만, 굳이 설정하지 않으면
자동으로 계산해서 값을 넣어준다.

결론 : 그냥 ip와 netmask만 설정하면 된다.
신고
Posted by 구차니
TAG ifconfig

댓글을 달아 주세요

Linux2009.06.09 20:50
ip 변경하기
$ ifconfig <interface> [[<AF>] <address>]
<AF>=Address family. Default: inet
  List of possible address families:
    unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
    ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)
    ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)
    ash (Ash) x25 (CCITT X.25)


mac 변경하기
$ ifconfig <interface> [hw <HW> <address>]
<HW>=Hardware Type.
  List of possible hardware types:
    loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
    slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
    strip (Metricom Starmode IP) ash (Ash) ether (Ethernet)
    tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
    ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
    arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
    sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
    irda (IrLAP) ec (Econet) x25 (generic X.25)
    eui64 (Generic EUI-64)

※ MAC을 변경하기 위해서는 nic device가 down 되어 있어야 하며, root권한이어야 함.

$ ifconfig eth0 hw ether 00:00:00:00:00:00
SIOCSIFHWADDR: Operation not permitted
$ sudo ifconfig eth0 hw ether 00:00:00:00:00:00
[sudo] password for user:
SIOCSIFHWADDR: Device or resource busy - you may need to down the interface


$ ifconfig --help


신고
Posted by 구차니
TAG ifconfig

댓글을 달아 주세요

Linux2009.01.20 23:45
윈도우에서는 ipconfig 라는 녀석으로 유선랜의 경우에는 dhcp까지 설정이 가능하다.
ipconfig /all <- 모든 어댑터 리스트 보기
ipconfig /renew <- dhcp 갱신

&lt;도움말&gt; ipconfig /?



리눅스에서는 조금은 분화가 되어있다.(윈도우에 익숙해서인지 불편하다)
ifconfig - configure a network interface
dhclient - Dynamic Host Configuration Protocol Client

iwconfig - configure a wireless network interface

iwspy - Get wireless statistics from specific nodes
iwlist - Get more detailed wireless information from a wireless interface

굳이 윈도우와 비교를 하자면
 windows  linux
 ipconfig  ifconig, iwconfig
 ipconfig /renew
 dhclient, dhcpcd

[dhcpcd : http://www.phystech.com/download/dhcpcd_man.html]
신고
Posted by 구차니

댓글을 달아 주세요