no route to host

Jez Hancock jez.hancock at
Wed May 7 06:16:25 PDT 2003

On Wed, May 07, 2003 at 10:52:32AM +0200, Ronald Weinrich wrote:
> Hi Jez Hancock,
> yesterday it was 4h in the morning so I had to go, I hope you get this mess. 
> I did what you said  - 
> now I'm able to ping 
> from the firewall-box to ep0 
> from the firewall-box to ed0- 
> from intranet 192,168,0,xx to ep0 and 
> from intranet 192,168,0,xx to ed0 
> from intranet not to the DNS1-box in inet  on or to the 
> 	router
> I guess that's the reason I can't conect to the internet 
> (does 160/8 mean 160 -175?) 
> from outside to ed0 works
> is that a  ipnat problem? or a routing problem?
> I add
> > Try adding a simple /etc/ipf.rules ruleset:
> > pass out all
> > pass in all
> > ipfilter_enable="YES"
> > ipfilter_rules="/etc/ipf.rules"
> > you have no entry for the ep0 interface and your ifconfig output
> > suggests ep0 isn't active (or even present).
> therefore I run a script at boot-time
> #!/bin/sh
> /sbin/ifconfig ep0 down
> /sbin/ifconfig ep0 inet netmask 0xffffff00 broadcast 
> /sbin/ifconfig ep0 up
> [ -x /sbin/ipnat ] && /sbin/ipnat -CF -f /etc/ipnat.conf && ipf -
> 	y && echo -n 'ipnat'
No - all your network interface configuration at boot time is done using
the 'ifconfig_' lines in /etc/rc.conf.

A good thing to do if you're familiar with shell scripting and unsure
how something is initiated at boot time is to grep for a keyword in the
/etc/ directory.

For example, say in this case you're wondering how your network
interfaces are initiated at boot time.  You know the command you use to
configure a network interface is 'ifconfig' so you grep for 'ifconfig'
in /etc.

Doing this yields quite a few 'hits':

[13:51:41] root at users /root# grep ifconfig /etc/*
/etc/pccard_ether:# pccard_ether interfacename [start|stop] [ifconfig
/etc/pccard_ether:case ${pccard_ifconfig} in
/etc/pccard_ether:      eval ifconfig_${interface}=\${pccard_ifconfig}
/etc/                ifconfig ${ifn} create
/etc/        # to go _before_ the general ifconfig section,
since in the case
/etc/        # gifconfig
/etc/                network_interfaces="`ifconfig -l`"

In this case you think, 'ah ok /etc/ must be where my network
ifaces are init'd', so you go investigate /etc/ in your

The /etc/ file isn't that hard to understand and worth reading
through a few times. The gist of it is that to bring up a network
interface at boot time you add a line in /etc/rc.conf along the lines:

ifconfig_ed0="inet  netmask"

Now this line above is used in /etc/ to build the command that
freebsd executes on boot.  The command resolves to:

ifconfig ed0 inet netmask

and will be executed at boot.

So, if you have additional interfaces you need configuring you should
add extra ifconfig_ lines to /etc/rc.conf.  In this case, add a line for
ep0, the netmask you want is  A line like this should do:

ifconfig_ep0="inet netmask"

(Incidentally this is all the /stand/sysinstall application does).

This line means ep0 will be brought up and will accept connections on from any host on the same network.  In this case, the 'same
network' is any machine on - any machine
in the range - will be able to talk to your
machine on the network interface ep0 (I think this is right, sure
someone will correct me if not!).

I would recommend you read this thread through fully a few times:

for information on netmasking - it covers how netmasking works with
particular relevance to FreeBSD.

To work out netmask ranges this calculator is good:

The page is IMO a bit intimidating, but as an example for the you'd enter and in
the second form on that page and then click 'calculate'. You can then
click on 'Explain' for an explanation of how your particular calculation
was worked out and what it means.

Hope that helps anyway,

More information about the freebsd-questions mailing list