Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7: minikube tunnel failed with "netstat: invalid option -- 'f'" #3498

Closed
zzzuzik opened this issue Dec 29, 2018 · 5 comments
Closed
Assignees
Labels
area/tunnel Support for the tunnel command good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. os/linux priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@zzzuzik
Copy link

zzzuzik commented Dec 29, 2018

minikube tunnel fails with:
netstat: invalid option -- 'f'

OS ver:

cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

netstat ver:

 netstat --version
net-tools 2.10-alpha

deployed from the default: net-tools:
net-tools.x86_64 0:2.0-0.24.20131004git.el7

@zzzuzik zzzuzik changed the title CentOS 7: mikikube tunnel failed with " CentOS 7: mikikube tunnel failed with "netstat: invalid option -- 'f'" Dec 29, 2018
@zzzuzik
Copy link
Author

zzzuzik commented Dec 29, 2018

netstat --help

usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}
       netstat [-vWnNcaeol] [<Socket> ...]
       netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]

        -r, --route              display routing table
        -I, --interfaces=<Iface> display interface table for <Iface>
        -i, --interfaces         display interface table
        -g, --groups             display multicast group memberships
        -s, --statistics         display networking statistics (like SNMP)
        -M, --masquerade         display masqueraded connections

        -v, --verbose            be verbose
        -W, --wide               don't truncate IP addresses
        -n, --numeric            don't resolve names
        --numeric-hosts          don't resolve host names
        --numeric-ports          don't resolve port names
        --numeric-users          don't resolve user names
        -N, --symbolic           resolve hardware names
        -e, --extend             display other/more information
        -p, --programs           display PID/Program name for sockets
        -o, --timers             display timers
        -c, --continuous         continuous listing

        -l, --listening          display listening server sockets
        -a, --all                display all sockets (default: connected)
        -F, --fib                display Forwarding Information Base (default)
        -C, --cache              display routing cache instead of FIB
        -Z, --context            display SELinux security context for sockets

  <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}
           {-x|--unix} --ax25 --ipx --netrom
  <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet
  List of possible address families (which support routing):
    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
    x25 (CCITT X.25)

@zzzuzik zzzuzik changed the title CentOS 7: mikikube tunnel failed with "netstat: invalid option -- 'f'" CentOS 7: minikube tunnel failed with "netstat: invalid option -- 'f'" Dec 30, 2018
@michal-franc
Copy link
Contributor

Same issue when running

make integration
Linux Mint 18.3 Sylvia

netstat version

net-tools 1.60
netstat 1.43

@tstromberg tstromberg added kind/bug Categorizes issue or PR as related to a bug. os/linux area/tunnel Support for the tunnel command labels Jan 19, 2019
@tstromberg
Copy link
Contributor

Curious! The tunnel should probably be made to use ip route if possible on Linux, but it does work on my Debian machine:

$ netstat -nr -f inet
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
...
$ netstat --version
net-tools 2.10-alpha
Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang, Brian Micek and others
+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N +SELINUX
AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE -BLUETOOTH
HW:  +ETHER +ARC +SLIP +PPP +TUNNEL -TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT +FDDI +HIPPI +HDLC/LAPB +EUI64 

@tstromberg tstromberg added this to the v1.0.0 milestone Jan 19, 2019
@zzzuzik
Copy link
Author

zzzuzik commented Jan 19, 2019

@tstromberg
Looks like RedHat distros uses capital ‘-F’ instead of ‘-f’

@tstromberg tstromberg added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jan 22, 2019
@tstromberg tstromberg modified the milestones: v1.0.0, v1.0.0-candidate, v0.34.0 Jan 22, 2019
@balopat balopat self-assigned this Jan 25, 2019
@balopat
Copy link
Contributor

balopat commented Jan 25, 2019

I'll look into this - it seems to mee that for linux using route -n would be a better option. The output format from route -n is very similar to netstat -nr (same from tunnel's perspective) and the default IP family is inet4 for both netstat and route on linux (unlike on FreeBSD/OSX). I'm planning to switch to route -n in route_linux.go.
I'm wondering what would be the benefit of ip route over route -n as it actually has a different output format too? @tstromberg?

The output below is from a centos7 docker container:

[root@38b5b6e0df3e /]#  netstat -nr 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.17.0.1      0.0.0.0         UG        0 0          0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth0
[root@38b5b6e0df3e /]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.17.0.1      0.0.0.0         UG    0      0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
[root@38b5b6e0df3e /]# ip route
default via 172.17.0.1 dev eth0 
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tunnel Support for the tunnel command good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. os/linux priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

4 participants