Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f0a8b4b0
Commit
f0a8b4b0
authored
Mar 09, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer iproute over ifconfig
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
faf09314
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
lxc-net.in
config/init/common/lxc-net.in
+11
-9
lxc-restore-net
src/lxc/lxc-restore-net
+1
-1
No files found.
config/init/common/lxc-net.in
View file @
f0a8b4b0
...
...
@@ -35,29 +35,31 @@ _netmask2cidr ()
}
ifdown
()
{
which ifconfig
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
ifconfig
$1
down
return
fi
which ip
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
ip
link set
dev
$1
down
return
fi
}
ifup
()
{
which ifconfig
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
ifconfig
$1
$2
netmask
$3
up
ifconfig
$1
down
return
fi
}
ifup
()
{
which ip
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
MASK
=
`
_netmask2cidr
${
LXC_NETMASK
}
`
CIDR_ADDR
=
"
${
LXC_ADDR
}
/
${
MASK
}
"
ip addr add
${
CIDR_ADDR
}
dev
$1
ip
link set
dev
$1
up
return
fi
which ifconfig
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
ifconfig
$1
$2
netmask
$3
up
return
fi
}
...
...
src/lxc/lxc-restore-net
View file @
f0a8b4b0
...
...
@@ -17,7 +17,7 @@ while true; do
if
[
"
$CRTOOLS_SCRIPT_ACTION
"
=
"network-unlock"
]
;
then
brctl addif
$bridge
$veth
i
fconfig
$veth
0.0.0.0
up
i
p
link set
dev
$veth
up
fi
i
=
$((
i+1
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment