1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-11 12:10:26 +08:00

add cidr hook in unix

This commit is contained in:
fumiama
2021-12-30 17:11:13 +08:00
parent bcfba4418f
commit cd060c7b92
4 changed files with 35 additions and 2 deletions

View File

@@ -6,6 +6,9 @@ package lower
func (n *NIC) prepare() {
execute("ifconfig", n.ifce.Name(), "inet", n.ip, n.ip, "up")
execute("route", "add", n.subnet, "-interface", n.ifce.Name())
for _, c := range n.cidrs {
execute("route", "add", c, "-interface", n.ifce.Name())
}
}
func (n *NIC) Up() {