C Program to make static ARP entries

Discussion in 'Linux Networking' started by jeniffer, Apr 20, 2006.

  1. jeniffer

    jeniffer Guest

    I need to write a c program to add static entries to the ARP cache.I
    read somewhere that we can use the ioctl() function and the arpreq
    structure to know the MAC address.This is the only info I could get
    related to ARP entries.
    Plz suggest how to add static entries in the ARP cache through a
    program.The system in linux .I know in windows that one can do arp -s
    through the command line.
    Plz suggest me pointers to go about.
    jeniffer, Apr 20, 2006
    1. Advertisements

  2. Like windows you can also add ARP entries to arp table in linux.
    The Syntax is:

    arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub]

    <HW>=Use '-H <hw>' to specify hardware address type. Default: ether

    Senthil Murugan
    SenthilMurugan, Apr 20, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.