Skip to content
Permalink
Browse files

NAT warning if IPv4 loopback address in /etc/resolv.conf

  • Loading branch information...
lantz committed Apr 4, 2019
1 parent 598d694 commit 664ba39383e4f6ea79203e935b139bb2a058e9d5
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/mn
4 bin/mn
@@ -388,6 +388,10 @@ class MininetRunner( object ):
listenPort=opts.listenport )

if opts.ensure_value( 'nat', False ):
with open( '/etc/resolv.conf' ) as f:
if 'nameserver 127.' in f.read():
warn( '*** Warning: loopback address in /etc/resolv.conf '
'may break host DNS over NAT\n')
mn.addNAT( *opts.nat_args, **opts.nat_kwargs ).configDefault()

# --custom files can set CLI or change mininet.cli.CLI

0 comments on commit 664ba39

Please sign in to comment.
You can’t perform that action at this time.