Monday 3 August 2015

DOCKER_OPTS in /etc/default/docker ignored on Ubuntu

For some reason, in debian 8 and ubuntu 15.01 systemd is skipping the execution of /etc/default/docker.

How to fix?

Copy the original systemd service file to /etc/systemd/system/

sudo cp  /lib/systemd/system/docker.service /etc/systemd/system/

Edit file /etc/systemd/system/docker.service
...
[Service]
ExecStart=/usr/bin/docker -d -H fd:// $DOCKER_OPTS
...
EnvironmentFile=-/etc/default/docker
...
Then execute:
sudo systemctl daemon-reload
sudo systemctl restart docker
Verify that /etc/default/docker is loaded
ps auxwww | grep docker
root      4989  0.8  0.1 265540 16608 ?        Ssl  10:37   0:00 /usr/bin/docker -d -H fd:// --insecure-registry 

That's it.

Possibly Related Posts

Monday 27 July 2015

Enable Layer3 on a Cisco Switch

This is what worked for me on a Cisco WS-C2960-24PS-L switch:

First you need to change the sdm prefer from dafult to lanbase-routing.
The lanbase-routing template supports IPv4 unicast routes for configuring static routing SVIs.
Static routing is supported only on switched virtual interfaces (SVIs) and not on physical interfaces. The switch does not support routing protocols.
conf t
sdm prefer lanbase-routing
end
wr
reload 

Then you have to enable ip routing:
conf t
ip routing
Then you can add the static routes you like.

Possibly Related Posts

Monday 16 February 2015

Configure CISCO Catalyst 2960 ports to monitoring/mirroring mode

This will send all traffic that comes on the 0/1-0/9 ports to the Ga0/1 interface:
switch>enable
switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

switch(config)#monitor session 1 source interface fastEthernet 0/1
switch(config)#monitor session 1 source interface fastEthernet 0/2
switch(config)#monitor session 1 source interface fastEthernet 0/3
switch(config)#monitor session 1 source interface fastEthernet 0/4
switch(config)#monitor session 1 source interface fastEthernet 0/5
switch(config)#monitor session 1 source interface fastEthernet 0/6
switch(config)#monitor session 1 source interface fastEthernet 0/7
switch(config)#monitor session 1 source interface fastEthernet 0/8

switch(config)#monitor session 1 destination interface gigabitEthernet 0/1
Show info:
switch#show monitor session 1
Session 1
---------
Type    : Local Session
Source Ports :
 Both: Fa0/1-8
Destination Ports : Gi0/1
 Encapsulation : Native
  Ingress : Disabled
And now we can capture this traffic:
# tcpdump -i eth0 -n

Possibly Related Posts

Monday 9 February 2015

One line web server

The following one line script will create a web server running on port 80 using nc (netcat):

while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 8080; done

Possibly Related Posts