www.duckland.org/public/post/2017/02/quick-nmcli-notes/index.html
2022-06-05 09:26:14 -05:00

522 lines
15 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https:\/\/www.duckland.org\/"
},
"articleSection" : "post",
"name" : "Quick nmcli notes",
"headline" : "Quick nmcli notes",
"description" : "This is a quick post so I can remember these details.\nSo, on the R810, I am currently running ArchLinux, which uses by default NetworkManager, which I have a love\/hate relationship with. At my last job, I recommended removing it from our servers, as under RHEL6, it does very odd things to the network and is hard to manage. I have heard that it is better under RHEL7. But, it does let you do some really cool things.",
"inLanguage" : "en",
"author" : "",
"creator" : "",
"publisher": "",
"accountablePerson" : "",
"copyrightHolder" : "",
"copyrightYear" : "2017",
"datePublished": "2017-02-16 19:38:42 -0700 -0700",
"dateModified" : "2017-02-16 19:38:42 -0700 -0700",
"url" : "https:\/\/www.duckland.org\/post\/2017\/02\/quick-nmcli-notes\/",
"wordCount" : "294",
"image" : "https://www.duckland.org/%!s(\u003cnil\u003e)"",
"keywords" : [ ""linux"",""R810"","Blog" ]
}
</script>
<title>Quick nmcli notes </title>
<meta name="description" content="Random Quacking" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://www.duckland.org/css/style.css?v=1654439072" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://www.duckland.org/css/custom.css?v=1654439072" rel="stylesheet" type='text/css' media='all'>
<link rel="shortcut icon" href="https://www.duckland.org/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://www.duckland.org/img/favicon.ico" type="image/x-icon">
</head>
<body class="post-template-default single single-post single-format-standard ct-body singular singular-post not-front standard">
<div id="overflow-container" class="overflow-container">
<a class="skip-content" href="#main">Skip to content</a>
<header id="site-header" class="site-header" role="banner">
<div class='top-navigation'>
<div class='container'>
<div id="menu-secondary" class="menu-container menu-secondary" role="navigation">
<button id="toggle-secondary-navigation" class="toggle-secondary-navigation"><i class="fas fa-plus"></i></button>
<div class="menu">
<ul id="menu-secondary-items" class="menu-secondary-items">
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/personal">personal</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/photos">photos</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/sa">sa</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/sitenews">sitenews</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/software">software</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/space">space</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/travel">travel</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/unix">unix</a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/work">work</a>
</li>
</ul>
</div>
</div>
<ul class="social-media-icons">
<li>
<a href="https://twitter.com/duckunix" data-animate-hover="pulse" class="twitter" target="_blank">
<i class="fab fa-twitter-square" title="twitter"></i>
<span class="screen-reader-text">twitter</span>
</a>
</li>
<li>
<a href="https://www.instagram.com/duckunix/" data-animate-hover="pulse" class="instagram" target="_blank">
<i class="fab fa-instagram" title="instagram"></i>
<span class="screen-reader-text">instagram</span>
</a>
</li>
<li>
<a href="mailto:duck@duckland.org" data-animate-hover="pulse" class="email">
<i class="fas fa-envelope" title="email"></i>
<span class="screen-reader-text">email</span>
</a>
</li>
<li>
<a href="https://www.linkedin.com/in/donaldharper/" data-animate-hover="pulse" class="linkedin" target="_blank">
<i class="fab fa-linkedin-in" title="linkedin"></i>
<span class="screen-reader-text">linkedin</span>
</a>
</li>
<li>
<a href="https://github.com/duckunix" data-animate-hover="pulse" class="github" target="_blank">
<i class="fab fa-github" title="github"></i>
<span class="screen-reader-text">github</span>
</a>
</li>
<li>
<a href="https://www.duckland.org/index.xml" data-animate-hover="pulse" class="rss" target="_blank">
<i class="fas fa-rss" title="rss"></i>
<span class="screen-reader-text">rss</span>
</a>
</li>
</ul></div>
</div>
<div class="container">
<div id="title-info" class="title-info">
<div id='site-title' class='site-title'>
<a href="/"> duckland.org </a>
</div>
</div>
<button id="toggle-navigation" class="toggle-navigation">
<i class="fas fa-bars"></i>
</button>
<div id="menu-primary-tracks" class="menu-primary-tracks"></div>
<div id="menu-primary" class="menu-container menu-primary" role="navigation">
<p class="site-description">Random Quacking</p>
<div class="menu">
<ul id="menu-primary-items" class="menu-primary-items">
<li class='menu-item menu-item-type-custom menu-item-object-custom '>
<a href="https://www.duckland.org/">Home</a>
</li>
<li class='menu-item menu-item-type-post_type menu-item-object-page '>
<a href="https://www.duckland.org/stories/about/">About</a>
</li>
<li class='menu-item menu-item-type-post_type menu-item-object-page '>
<a href="https://www.duckland.org/stories/privacy/">Privacy</a>
</li>
<li class='menu-item menu-item-type-post_type menu-item-object-page '>
<a href="https://www.duckland.org/photos/">Photo Galleries</a>
</li>
</ul>
</div>
</div>
</div>
</header>
<div id="main" class="main" role="main">
<div id="loop-container" class="loop-container">
<div class="post type-post status-publish format-standard hentry category-standard category-travel entry full-without-featured odd excerpt-1">
<div class="entry-meta">
<span class="date">16 February</span> <span> / </span>
<span class="author">
<a href="https://www.duckland.org/" title="Posts by Don Harper" rel="author">Don Harper</a>
</span>
<span class="category">
<span> / </span>
<a href="/categories/unix">unix</a>
</span>
<span class="category">
<span> / </span>
<a href="/categories/sa">sa</a>
</span>
</div>
<div class='entry-header'>
<h1 class='entry-title'> Quick nmcli notes</h1>
</div>
<div class="entry-container">
<div class="entry-content">
<article>
<p>This is a quick post so I can remember these details.</p>
<p>So, on the <a href="/tags/r810/">R810</a>, I am currently running <a href="https://archlinux.org">ArchLinux</a>, which uses by default <a href="https://wiki.archlinux.org/index.php/NetworkManager">NetworkManager</a>, which I have a love/hate relationship with. At my last job, I recommended removing it from our servers, as under <a href="https://www.redhat.com">RHEL6</a>, it does very odd things to the network and is hard to manage. I have heard that it is better under RHEL7. But, it does let you do some really cool things. On the R810, there is a cellular modem, and on previous installes, I have had it configured and scripted using <strong>nmcli</strong> to easily bring up and down the cellular connections.</p>
<p>The problem I am facing now is that my current DHCP server for the house does not let me provide two MAC Address for a single IP, so when I dock the R810, it gets a different IP address than when it is on WiFi. Very annoying. Also, for some reason, it would prefer to use WiFi when the ethernet connection was present, thus giving me a slower connection.</p>
<p>The documentation I found was a bit light in examples and/or dated (I am running version 1.6.2 of NetworkManager, and the examples were from 1.2.x or 1.4.x, which did not work). So, with a bit of expermenting, I finally got it fixed to:</p>
<ul>
<li>Chose the ethernet connection over the Wifi when both are present</li>
<li>&lsquo;Clone&rsquo; the MAC address of the Wifi NIC to the ethernet NIC</li>
</ul>
<p>Here are the commands. <strong>local</strong> is what I called the local ethernet connection, and <strong>home-wifi</strong> is what I call the house Wifi Network.</p>
<ul>
<li>To set the MAC adress:</li>
</ul>
<blockquote>
<p>nmcli connection modify local ethernet.cloned-mac-address aa:bb:cc:dd:ee:ff</p>
</blockquote>
<ul>
<li>To set the connection priorities:</li>
</ul>
<blockquote>
<p>nmcli connection modify local connection.autoconnect-priority 999<br>
nmcli connection modify home-wifi connection.autoconnect-priority 999</p>
</blockquote>
</article>
</div>
<div class='entry-meta-bottom'>
<div class="entry-categories"><p><span>Categories</span>
<a href="/categories/unix" title="View all posts in unix">unix</a>
<a href="/categories/sa" title="View all posts in sa">sa</a>
</p>
</div>
<div class="entry-tags"><p><span>Tags</span>
<a href="/tags/linux" title="View all posts tagged linux">linux</a>
<a href="/tags/r810" title="View all posts tagged R810">R810</a>
</p></div> </div>
<div class="author-meta">
<div class="author">
<img alt='Don Harper' src="https://www.gravatar.com/avatar/343531b2be7fcd30e48f5c07dcd2176f?s=100&d=identicon" class='avatar avatar-72 photo' height='72' width='72'>
<span>
Written by:<a href="https://www.duckland.org/" title="Posts by Don Harper" rel="author">Don Harper</a> </span>
</div>
<div class="bio">
<p>Don is a computer guy stumbling through life trying to raise his kids and take some pictures</p>
<a class="twitter" target="_blank"
href="https://twitter.com/duckunix">
<i class="fab fa-twitter-square"
title="twitter icon"></i>
</a>
<a class="linkedin" target="_blank"
href="https://www.linkedin.com/in/donaldharper/">
<i class="fab fa-linkedin"
title="linkedin icon"></i>
</a>
<a class="email" target="_blank"
href="mailto:duck@duckland.org">
<i class="fas fa-envelope"
title="email icon"></i>
</a>
<a class="instagram" target="_blank"
href="https://www.instagram.com/duckunix/">
<i class="fab fa-instagram"
title="instagram icon"></i>
</a>
<a class="github" target="_blank"
href="https://github.com/duckunix">
<i class="fab fa-github"
title="github icon"></i>
</a>
</div>
</div>
</div>
</div>
<section id="comments" class="comments">
</section>
</div>
</div>
<footer id="site-footer" class="site-footer" role="contentinfo">
<h1>
<a href=""> duckland.org </a>
</h1>
<p class="site-description">Random Quacking</p>
<div id="menu-footer" class="menu-container menu-footer" role="navigation">
<div class="menu">
<ul id="menu-footer-items" class="menu-footer-items">
</ul>
</div> </div>
<ul class="social-media-icons">
<li>
<a href="https://twitter.com/duckunix" class="twitter" target="_blank">
<i class="fab fa-twitter-square" title="twitter"></i>
<span class="screen-reader-text">twitter</span>
</a>
</li>
<li>
<a href="https://www.instagram.com/duckunix/" class="instagram" target="_blank">
<i class="fab fa-instagram" title="instagram"></i>
<span class="screen-reader-text">instagram</span>
</a>
</li>
<li>
<a href="mailto:duck@duckland.org" class="email">
<i class="fas fa-envelope" title="email"></i>
<span class="screen-reader-text">email</span>
</a>
</li>
<li>
<a href="https://www.linkedin.com/in/donaldharper/" class="linkedin" target="_blank">
<i class="fab fa-linkedin-in" title="linkedin"></i>
<span class="screen-reader-text">linkedin</span>
</a>
</li>
<li>
<a href="https://github.com/duckunix" class="github" target="_blank">
<i class="fab fa-github" title="github"></i>
<span class="screen-reader-text">github</span>
</a>
</li>
<li>
<a href="https://www.duckland.org/index.xml" data-animate-hover="pulse" class="rss" target="_blank">
<i class="fas fa-rss" title="rss"></i>
<span class="screen-reader-text">rss</span>
</a>
</li>
</ul> <div class="design-credit">
<p>© 2006-2021 Don Harper</p>
</div>
</footer>
</div>
<script src="https://www.duckland.org/js/jquery.min.js"></script>
<script src="https://www.duckland.org/js/jquerymigrate.js"></script>
<script src="https://www.duckland.org/js/production.min.js?v=1654439072"></script>
</body>
</html>