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

完善主程序

This commit is contained in:
fumiama
2021-12-28 21:50:10 +08:00
parent f0956ae742
commit 6ae8e88bd1
18 changed files with 499 additions and 14 deletions

18
lower/tun_linux.go Normal file
View File

@@ -0,0 +1,18 @@
//go:build linux
// +build linux
package lower
func (n *NIC) prepare() {
execute("/sbin/ip", "link", "set", "dev", ifcename, "mtu", "1500")
execute("/sbin/ip", "addr", "add", ip, "dev", ifcename)
execute("/sbin/ip", "route", "add", subnet, "dev", ifcename)
}
func (n *NIC) Up() {
execute("/sbin/ip", "link", "set", "dev", ifcename, "up")
}
func (n *NIC) Down() {
execute("/sbin/ip", "link", "set", "dev", ifcename, "down")
}