Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 20:29:51 -0800
From:      Wes Peters <wes@softweyr.com>
To:        Karl Timmermann <timmerk@tcimet.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Arp and Route Commands
Message-ID:  <3DDB0FBF.889B6AEF@softweyr.com>
References:  <A17CAE24-FA6E-11D6-B39A-0030656EB864@tcimet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Karl Timmermann wrote:
> 
> Hello,
> 
> I'm new to the list and was hoping maybe someone could help me. These
> commands work in Linux (and in this order), but not in FreeBSD/Mac OS X
> as the arp and route commands are different:
> 
> arp -s 10.10.10.0 00:00:ca:13:4b:54 -i eth1
> arp -s 10.10.10.0 00:00:ca:13:4b:54 -i eth1
> route add -net 10.10.10.0 netmask 255.255.255.0 dev eth1
> route add default gw 10.10.10.0 dev eth1
> 
> anyone know how i would change these commands to work with the FreeBSD
> versions of arp and route?

Read the man pages carefully.  The BSD TCP/IP stack has a single arp
cache and a single route table, so the network interfaces do not
need to be specified.  In particular, with arp you specify only the
hostname and ethernet address.  The route command you specify the
IP address or hostname of the router rather than the egress interface.
Your commands would become:

arp -s 10.10.10.0 00:00:ca:13:4b:54

route add -net 10.10.10.0 -netmask 255.255.255.0 {IP address of router}
route add default {IP address of router}

Please note that in general you don't want to set these by hand, but
rather use the rc.conf file.

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
wes@softweyr.com                                           http://softweyr.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DDB0FBF.889B6AEF>