Jump to content

Hi

The below file shows the contents of the interfaces file.

/etc/network/interfaces 

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

#allow-hotplug wlan0
#iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 192.168.0.50
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 8.8.8.8 8.8.4.4

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
	address 192.168.1.1
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255

However when I do ifconfig, I get the following

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:31104 (30.3 KiB)  TX bytes:31104 (30.3 KiB)

wlan0 	  Link encap:Ethernet  HWaddr b8:27:eb:71:4d:84
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:180 (180.0 B)  TX bytes:0 (0.0 B)

wlan1 	  Link encap:Ethernet  HWaddr 08:6a:0a:64:18:49
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:180 (180.0 B)  TX bytes:0 (0.0 B)

 

Any Suggestions?

 

Thank you

Link to comment
https://linustechtips.com/topic/756013-etcnetworkinterfaces-file-being-ingored/
Share on other sites

Link to post
Share on other sites

reboot?  Failing that remove :

allow-hotplug eth0

Network configuration via /etc/network/interfaces is a bit broken in general.  Do not expect anything fancy to work properly like bonding with vlans,  

 

I resorted to a bash script that I run via /etc/rc.local at startup to configure my servers,  (Dual 10Gb LACP VLAN trunks, with the IP address on vlan sub interfaces)

Link to post
Share on other sites

My memory failed me, actually ended up getting it working via a script call, so pulled it out of /etc/rc.local

 

Here is the write up from my notes if anyone is interested anyway.

Bond and VLAN setup linux servers
apt-get install ifenslave vlan
modprobe 8021q
modprobe bonding
 
echo 'bonding' >> /etc/modules
echo '8021q' >> /etc/modules
 
root@foo:~# cat /etc/modprobe.d/bonding.conf 
alias bond0 bonding
    options bonding mode=4 miimon=100 lacp_rate=1 use_carrier=0
 
 
root@ff:~# cat /etc/network/interfaces
auto bond0
iface bond0 inet manual
    pre-up /root/bond0-up
    bond-mode 4
    bond-miimon 100
    bond-lacp-rate 1
 
 
# The primary network interface
auto bond0.25
iface bond0.25 inet static
address 10.23.2.23
netmask 255.255.255.0
network 10.23.2.0
broadcast 10.23.2.255
gateway 10.23.2.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.23.2.2
dns-search luke.is.better
vlan-raw-device bond0
 
auto bond0.78
iface bond0.78 inet static
       address 10.13.0.67
       netmask 255.255.0.0
       vlan-raw-device bond0
 
 
 
 root@foo:~# cat /root/bond0-up
#!/bin/sh -e
#
modprobe bonding mode=4 miimon=100
ip link set ens120f1 master bond0
ip link set ens120f0 master bond0
echo "Sleeping for 30s to allow the LACP trunk to fully come up"
sleep 30
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×