Ubuntu Pastebin

Paste from smoser at Fri, 2 Jun 2017 13:51:45 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# The original goal was to test bug 1690388 (http://pad.lv/1690388)
# which reports to add mac address setting for a vlan.
#
# I took the basic config curtin examples/network-vlan.yaml [1]
# I modified it slightly to:
#   a.) add the correct mac address for my nic in a openstack vm.
#   b.) add the 'subnets: [{type: dhcp}]' line.
#
# Then I tried basically to manually put that into the system using
# net-convert, and reboot, expecting networking to come up.
#
# vlan fails to come up.  Instead of a nic named 'eth0.101', I get
# a nic named 'ens3'.
#
## finding: luser error. bah. I botched the 'rm' of .link files, leaving the
## previously generated cloud-init file
##  /etc/systemd/network/50-cloud-init-ens3.link
## and the vlan nic was getting renamed based on that.
##
#
# Further question... is there a problem with 70-persistent-net.rules 
# 
#
# [1] http://bazaar.launchpad.net/~curtin-dev/curtin/trunk/view/head:/examples/network-vlan.yaml

$ cat foo.cfg
network:
  version: 1
  config:
    # Physical interfaces.
    - type: physical
      name: eth0
      mac_address: "fa:16:3e:4b:63:49"
      subnets: [{type: dhcp}]
    # VLAN interface.
    - type: vlan
      name: eth0.101
      vlan_link: eth0
      vlan_id: 101
      mtu: 1500
      subnets:
        - type: static
          address: 192.168.0.2/24

$ python3 ./net-convert.py   \
   --network-data=foo.cfg --kind=yaml  \
   --output-kind=eni --directory=out.d | pastebinit
http://paste.ubuntu.com/24748387/

== out.d/etc/udev/rules.d/70-persistent-net.rules ==
 | SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="fa:16:3e:4b:63:49", NAME="eth0"
== out.d/etc/network/interfaces ==
 | auto lo
 | iface lo inet loopback
 | 
 | auto eth0
 | iface eth0 inet dhcp
 | 
 | auto eth0.101
 | iface eth0.101 inet static
 |     address 192.168.0.2/24
 |     mtu 1500
 |     vlan-raw-device eth0
 |     vlan_id 101
== out.d/etc/systemd/network/50-cloud-init-eth0.link ==
 | [Match]
 | MACAddress=fa:16:3e:4b:63:49
 | 
 | [Link]
 | Name=eth0


$ sudo cp out.d/etc/network/interfaces /etc/network/interfaces
$ sudo rm -f /etc/systemd/network/50-cloud-init-*

## drop the .rules files and update the initramfs
$ sudo cp out.d/etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules
$ sudo update-initramfs -u -k all

## reboot
$ sudo reboot


## go back in
$ ifconfig -a
ens3      Link encap:Ethernet  HWaddr fa:16:3e:4b:63:49  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr fa:16:3e:4b:63:49  
          inet addr:10.5.0.8  Bcast:10.5.255.255  Mask:255.255.0.0
          inet6 addr: fe80::f816:3eff:fe4b:6349/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:8958  Metric:1
          RX packets:191 errors:0 dropped:0 overruns:0 frame:0
          TX packets:171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17704 (17.7 KB)  TX bytes:21651 (21.6 KB)

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:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)


$ systemctl status --full --no-pager --output=short-precise networking.service  | cat
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since Fri 2017-06-02 13:25:20 UTC; 3min 10s ago
     Docs: man:interfaces(5)
  Process: 879 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 783 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/SUCCESS)
 Main PID: 879 (code=exited, status=1/FAILURE)

Jun 02 13:25:20.351823 xenial-20170519-184349 systemd[1]: Starting Raise network interfaces...
Jun 02 13:25:20.687650 xenial-20170519-184349 ifup[879]: Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Jun 02 13:25:20.694994 xenial-20170519-184349 ifup[879]: ERROR: trying to add VLAN #101 to IF -:eth0:-  error: File exists
Jun 02 13:25:20.697558 xenial-20170519-184349 ifup[879]: Cannot find device "eth0.101"
Jun 02 13:25:20.697875 xenial-20170519-184349 ifup[879]: Failed to bring up eth0.101.
Jun 02 13:25:20.723060 xenial-20170519-184349 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jun 02 13:25:20.723639 xenial-20170519-184349 systemd[1]: Failed to start Raise network interfaces.
Jun 02 13:25:20.729119 xenial-20170519-184349 systemd[1]: networking.service: Unit entered failed state.
Jun 02 13:25:20.732909 xenial-20170519-184349 systemd[1]: networking.service: Failed with result 'exit-code'.


$ sudo cat /proc/net/vlan/config
VLAN Dev name   | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
ens3           | 101  | eth0


$ cp /var/log/cloud-init.log .
# edit it to get only this boot
$ pastebinit cloud-init.log
http://paste.ubuntu.com/24748526/

$ sudo sh -c 'cd /sys/class/net/ && grep -r .  ens3/'
ens3/mtu:1500
ens3/type:1
grep: ens3/phys_port_name: Operation not supported
ens3/netdev_group:0
ens3/flags:0x1002
ens3/power/control:auto
ens3/power/async:disabled
ens3/power/runtime_enabled:disabled
ens3/power/runtime_active_kids:0
ens3/power/runtime_active_time:0
grep: ens3/power/autosuspend_delay_ms: Input/output error
ens3/power/runtime_status:unsupported
ens3/power/runtime_usage:0
ens3/power/runtime_suspended_time:0
grep: ens3/speed: Invalid argument
grep: ens3/dormant: Invalid argument
ens3/name_assign_type:4
ens3/proto_down:0
ens3/addr_assign_type:0
grep: ens3/phys_switch_id: Operation not supported
ens3/dev_id:0x0
grep: ens3/duplex: Invalid argument
ens3/gro_flush_timeout:0
ens3/iflink:2
grep: ens3/phys_port_id: Operation not supported
ens3/addr_len:6
ens3/address:fa:16:3e:4b:63:49
ens3/operstate:down
ens3/carrier_changes:0
ens3/broadcast:ff:ff:ff:ff:ff:ff
ens3/queues/rx-0/rps_flow_cnt:0
ens3/queues/rx-0/rps_cpus:0
ens3/queues/tx-0/xps_cpus:0
ens3/queues/tx-0/tx_maxrate:0
ens3/queues/tx-0/tx_timeout:0
ens3/queues/tx-0/byte_queue_limits/limit:0
ens3/queues/tx-0/byte_queue_limits/limit_max:1879048192
ens3/queues/tx-0/byte_queue_limits/limit_min:0
ens3/queues/tx-0/byte_queue_limits/hold_time:1000
ens3/queues/tx-0/byte_queue_limits/inflight:0
ens3/tx_queue_len:1000
ens3/uevent:DEVTYPE=vlan
ens3/uevent:INTERFACE=ens3
ens3/uevent:IFINDEX=3
ens3/statistics/rx_fifo_errors:0
ens3/statistics/collisions:0
ens3/statistics/rx_errors:0
ens3/statistics/rx_compressed:0
ens3/statistics/rx_dropped:0
ens3/statistics/tx_packets:0
ens3/statistics/tx_errors:0
ens3/statistics/rx_missed_errors:0
ens3/statistics/rx_over_errors:0
ens3/statistics/tx_carrier_errors:0
ens3/statistics/tx_heartbeat_errors:0
ens3/statistics/rx_crc_errors:0
ens3/statistics/multicast:0
ens3/statistics/tx_fifo_errors:0
ens3/statistics/tx_aborted_errors:0
ens3/statistics/rx_bytes:0
ens3/statistics/tx_compressed:0
ens3/statistics/tx_dropped:0
ens3/statistics/rx_packets:0
ens3/statistics/tx_bytes:0
ens3/statistics/tx_window_errors:0
ens3/statistics/rx_frame_errors:0
ens3/statistics/rx_length_errors:0
ens3/dev_port:0
ens3/ifindex:3
ens3/link_mode:0
grep: ens3/carrier: Invalid argument


$ sudo sh -c '( cd /proc/net/vlan && grep -r . * )'
config:VLAN Dev name  | VLAN ID
config:Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
config:ens3           | 101  | eth0
ens3:ens3  VID: 101   REORDER_HDR: 1  dev->priv_flags: 1001
ens3:         total frames received            0
ens3:          total bytes received            0
ens3:      Broadcast/Multicast Rcvd            0
ens3:      total frames transmitted            0
ens3:       total bytes transmitted            0
ens3:Device: eth0
ens3:INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
ens3: EGRESS priority mappings: 


$ dmesg | grep ens3
[    7.866724] ens3: renamed from eth0.101

$ dmesg | pastebinit
http://paste.ubuntu.com/24748553/

$ read up idle < /proc/uptime ; date -R --date="$up seconds ago"
Fri, 02 Jun 2017 13:25:12 +0000
Download as text