CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    6

    Create a routing entry to a network interface

    Hi all,
    I want to create a host routing entry that points to an interface, e.g. I want that all traffic to address 1.2.3.4 goes through interface 1.
    "route add 1.2.3.4 IF 1" does not work, route requires a netmask and a gateway. This is something I don't have. A single host has no netmask and I don't have a gateway on the other end of the interface.

    Any suggestions?

  2. #2
    Join Date
    Mar 2004
    Posts
    6
    To illustrate what I want, here is an example from Linux:
    Code:
    orbit-linux:/home/orbit # netstat -rn
    Kernel IP Routentabelle
    Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface
    10.1.25.0       0.0.0.0         255.255.255.0   U         0 0          0 eth0
    0.0.0.0         10.1.25.1       0.0.0.0         UG        0 0          0 eth0
    orbit-linux:/home/orbit # route add -host 1.2.3.4 dev eth0
    orbit-linux:/home/orbit # netstat -rn
    Kernel IP Routentabelle
    Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface
    1.2.3.4         0.0.0.0         255.255.255.255 UH        0 0          0 eth0
    10.1.25.0       0.0.0.0         255.255.255.0   U         0 0          0 eth0
    0.0.0.0         10.1.25.1       0.0.0.0         UG        0 0          0 eth0

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width