[BusyBox] About the gateway ip attach to eth0

Peter V. Saveliev peet at peet.spb.ru
Tue Nov 2 07:18:17 UTC 2004


On Tuesday 02 November 2004 03:56, Shu-Liang Lee wrote:
> Hello ...
>  
> I tested our device in a complicated MESH network.
> The network provided the information as follow
>  
> IP: 172.16.3.10
> Netmask: 255.255.255.0
> Gateway: 192.168.4.2
>  
> Questions, I found the /proc/net/route can not attach this gateway ip...

If you wanna add IP _not_ from your subnet as a gateway, you are to
use "dev" & "onlink" parameters with "ip":

8< ---- just a sample ----

ip link set dev eth0 up
ip addr add 172.16.3.10/24 dev eth0
ip route add default via 192.168.4.2 dev eth0 onlink

8< ---- just a sample ----


I don't know, whether busybox' ip can that, but ip from iproute2 can.

If I understood you properly.

> And the /proc/net/arp can not add this gateway ip entry.
>  
> In the Busybox, does any utility that it can add arp table entry...and
> how to use, please give me a example, thanks.
> I just know the arping, but I do not know how to use, is this the arping
> utility can add arp table entry??

You can also use ip:

8< ---- just a sample ----

ip neigh add 192.168.4.2 lladdr 0:1:2:3:4:5 dev eth0 nud permanent

8< ---- just a sample ----

this sample defines ipaddr:lladdr accordance, if you won't accept
this ipaddr from other lladdrs

<skip />

-- 
Peter V. Saveliev



More information about the busybox mailing list