mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-11 20:20:27 +08:00
完善主程序
This commit is contained in:
18
lower/tun_linux.go
Normal file
18
lower/tun_linux.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user