summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/sample
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2021-01-23 02:19:36 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2021-01-23 21:43:01 +0100
commit4e0e658f9bab3348925398a411c0670cfc84714c (patch)
tree597da4872d960bd00a57bbabab477b9507ee14c1 /pkg/tcpip/sample
parent6e97bcdf505f60c362e4ba7cc648d3b6f9e3fa18 (diff)
set default route via gre tunnel
Diffstat (limited to 'pkg/tcpip/sample')
-rw-r--r--pkg/tcpip/sample/tun_tcp_connect/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/sample/tun_tcp_connect/main.go b/pkg/tcpip/sample/tun_tcp_connect/main.go
index e0ab521ff..dd5bd9b3f 100644
--- a/pkg/tcpip/sample/tun_tcp_connect/main.go
+++ b/pkg/tcpip/sample/tun_tcp_connect/main.go
@@ -275,7 +275,7 @@ func main() {
// Add default route.
subnet, err := tcpip.NewSubnet(
- tcpip.Address(net.ParseIP("10.0.1.0").To4()),
+ tcpip.Address(net.ParseIP("10.0.0.0").To4()),
tcpip.AddressMask(net.ParseIP("255.255.255.0").To4()))
if err != nil {
panic(err)
@@ -283,11 +283,11 @@ func main() {
s.SetRouteTable([]tcpip.Route{
{
Destination: subnet,
- NIC: 2,
+ NIC: 1,
},
{
Destination: header.IPv4EmptySubnet,
- NIC: 1,
+ NIC: 2,
},
})
log.Printf("Nics enabled 1:%v 2:%v 3:%v", s.CheckNIC(1), s.CheckNIC(2), s.CheckNIC(3))