[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: setting up network



On Sun, Jan 23, 2005 at 08:26:43PM +0100, Kai Hildebrandt wrote:

> I use the map-scheme to decide which connection has to be used. If you
> have an Internet router at home your laptop can ping on this should
> work.
> You have to define a mapping in /etc/network/interfaces:

Same example as you, but using guessnet:

-------------------------------------------------------------------------------
mapping eth0
        script /usr/sbin/guessnet-ifupdown
        map default: hotel

iface home inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 192.168.1.1
        dns-search your-nework.de

	# test* options are implemented by guessnet
	# This would be what you are doing:
	#test-peer address 192.168.1.1
	# Strongly suggested to also include the peer MAC address in the
	# test, so that you're sure that you're matching the right host
	test-peer address 192.168.1.1 mac AA:BB:CC:DD:EE:FF

iface hotel inet dhcp
-------------------------------------------------------------------------------

And that's it: no other scripts needed, scan is done with a simple ARP
request that works also if the gateway firewalls pings, no need to
supply a source address, many different hosts can be scanned in
parallel.

And if you want to get rid of the DCHP scan at boot if you're unplugged,
you can add this other stanza:

iface none inet static
	# 0.0.0.0 doesn't work with some network drivers: if it is your
	# case, use some random address like 10.0.0.1/24.
	# Better ways of handling this have been suggested to ifupdown:
	# see bugs #76142, #92993, #96265, #129003, #164823, #171981 or
	# even better #204641.
        address 0.0.0.0
        netmask 0.0.0.0
        test missing-cable


Ciao,

Enrico

--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico@debian.org>

Attachment: signature.asc
Description: Digital signature


Reply to: