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

Re: stretch and DNS name resolution service for other devices on a LAN



On Wed 28 Feb 2018 at 19:42:27 (+0100), Pascal Hambourg wrote:
> Le 28/02/2018 à 18:14, David Wright a écrit :
> >
> >$ cat /etc/network/interfaces /etc/network/interfaces.d/directcable
> ># This file describes the network interfaces available on your system
> ># and how to activate them. For more information, see interfaces(5).
> >
> >source /etc/network/interfaces.d/*
> >
> ># The loopback network interface
> >auto lo
> >iface lo inet loopback
> >
> >#
> ># /etc/interfaces.d/directcable for west 2018-02-25
> >
> >auto eth0
> >iface eth0 inet static
> >   address 192.168.2.15/24
> 
> Fine. You could also add "allow-hotplug eth0" in case eth0 would be
> discovered late.

OK. Tried that here. The   ip a   is before and after connecting the cable.

$ cat /etc/network/interfaces /etc/network/interfaces.d/directcable-hot-plug 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

#
# /etc/interfaces.d/directcable for west 2018-02-25

allow-hotplug eth0
iface eth0 inet static
  address 192.168.2.15/24

#
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1c:23:3b:9f:34 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1c:bf:d5:28:76 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.15/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::21c:bfff:fed5:2876/64 scope link 
       valid_lft forever preferred_lft forever
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1c:23:3b:9f:34 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::21c:23ff:fe3b:9f34/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1c:bf:d5:28:76 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.15/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::21c:bfff:fed5:2876/64 scope link 
       valid_lft forever preferred_lft forever
$ 

> >$ ip a
> >2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
> >     link/ether 00:1c:23:3b:9f:34 brd ff:ff:ff:ff:ff:ff
> >     inet6 fe80::21c:23ff:fe3b:9f34/64 scope link
> >        valid_lft forever preferred_lft forever
> 
> The IPv4 address is not configured on eth0. No need to check the
> connectivity with ping, it won't work until the IPv4 addresses are
> configured on both ethernet interfaces.
> 
> After adding the iface stanza, did you restart the system, or start
> the interface with "ifup -a" ?

Yes. AFAIK there's no clean way to restart networking, so I've always
rebooted at both ends after making any change.

# ifup -a
# ifup eth0
ifup: interface eth0 already configured
# 

If I reboot but forget to disconnect the cable, then the machines
come up in a deadly embrace, ie each is the default IPv4 gateway
for the other, by way of the cable. OTOH in the absence of
/etc/interfaces.d/directcable or /etc/interfaces.d/directcable-hot-plug,
the machines come up normally, with their gateway through the wlan0
interface, but also able to transfer files or login to one another
through the already connected cable. I just tested that from this
laptop two floors below them both.

Cheers,
David.


Reply to: