<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sexy Sexy Penguins &#187; ip</title>
	<atom:link href="http://sexysexypenguins.com/tag/ip/feed/" rel="self" type="application/rss+xml" />
	<link>http://sexysexypenguins.com</link>
	<description>A lazy admin is a good admin!</description>
	<lastBuildDate>Sat, 21 Jun 2014 13:28:07 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.1</generator>
	<item>
		<title>Changing the IP range for docker0</title>
		<link>http://sexysexypenguins.com/2014/05/07/changing-the-ip-range-for-docker0/</link>
		<comments>http://sexysexypenguins.com/2014/05/07/changing-the-ip-range-for-docker0/#comments</comments>
		<pubDate>Wed, 07 May 2014 22:02:45 +0000</pubDate>
		<dc:creator><![CDATA[herlo]]></dc:creator>
				<category><![CDATA[docker]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://sexysexypenguins.com/?p=1209</guid>
		<description><![CDATA[Lately, I&#8217;ve been tinkering a lot with docker. Mostly, I&#8217;ve been doing it for work at The Linux Foundation. But I do have a desire to have docker instances on my local box for distros which I do not run. &#8230; <a href="http://sexysexypenguins.com/2014/05/07/changing-the-ip-range-for-docker0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Lately, I&#8217;ve been tinkering a lot with docker. Mostly, I&#8217;ve been doing it for work at <a href="https://linuxfoundation.org">The Linux Foundation</a>. But I do have a desire to have docker instances on my local box for distros which I do not run.</p>
<p>While doing some testing for work on my personal laptop, I noticed that the network which docker uses for it&#8217;s bridge, aptly named <em>docker0</em>, was in the same network as one of our VPNs.</p>
<pre># ip a s docker0
7: docker0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 ...
 link/ether fe:54:00:18:1a:fd brd ff:ff:ff:ff:ff:ff
 inet 172.17.41.1/16 brd 10.100.72.255 scope global docker0
 ..snip..

# ip a s tun0
139: tun0: &lt;POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP&gt; mtu 1412 ...
    link/none 
    inet 172.17.123.32/24 brd 172.17.224.255 scope global tun0
       valid_lft forever preferred_lft forever</pre>
<p>As you can tell, the <em>docker0</em> network bridge covers all of the <em>tun0</em> network. Any time I would attempt to ssh into one of the systems inside the VPN, it would time out. I was left wondering why for a few moments.</p>
<p>Luckily, it&#8217;s very easy to fix this problem. All that is needed is a defined bridge for <em>docker0</em> and to restart the docker service. Here&#8217;s what to do:</p>
<p>First, stop docker:</p>
<pre># service docker stop
Redirecting to /bin/systemctl stop  docker.service</pre>
<p>Next, create the network bridge file. You can choose any IP range you like. On Fedora 19, it looks like this:</p>
<pre># cat /etc/sysconfig/network-scripts/ifcfg-docker0 
DEVICE="docker0"
TYPE="Bridge"
ONBOOT="yes"
NM_CONTROLLED="no"
BOOTPROTO="static"
IPADDR=10.100.72.254
NETMASK=255.255.255.0</pre>
<p>Restart your network services.  <strong>NOTE:</strong> <em>service network restart</em> may be needed.</p>
<pre># service NetworkManager restart
Redirecting to /bin/systemctl restart  NetworkManager.service</pre>
<p>The <em>docker0</em> bridge should now be in a range outside the VPN.</p>
<pre># ip a s docker0
7: docker0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 ...
    link/ether fe:54:00:18:1a:fd brd ff:ff:ff:ff:ff:ff
    inet 10.100.72.254/24 brd 10.100.72.255 scope global docker0</pre>
<p>Starting new containers with docker should get IP addesses in the above range:</p>
<pre># service docker start
Redirecting to /bin/systemctl start  docker.service

# docker run -i -t herlo/fedora:20 /bin/bash
bash-4.2# ip a s eth0
141: eth0: &lt;BROADCAST,UP,LOWER_UP&gt; mtu 1412 ...
    link/ether fa:5f:e3:8d:61:f2 brd ff:ff:ff:ff:ff:ff
    inet 10.100.72.2/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::f85f:e3ff:fe8d:61f2/64 scope link 
       valid_lft forever preferred_lft forever</pre>
<p><strong>SUCCESS!</strong></p>
<p>Cheers,</p>
<p>herlo</p>
]]></content:encoded>
			<wfw:commentRss>http://sexysexypenguins.com/2014/05/07/changing-the-ip-range-for-docker0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
