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

sudo ifconfig eth0 up doesn't bring up network #12011

Closed
1 of 2 tasks
gigit0000 opened this issue Sep 9, 2024 · 5 comments
Closed
1 of 2 tasks

sudo ifconfig eth0 up doesn't bring up network #12011

gigit0000 opened this issue Sep 9, 2024 · 5 comments

Comments

@gigit0000
Copy link

gigit0000 commented Sep 9, 2024

Windows Version

Microsoft Windows [Version 10.0.19045.4780]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.10.16.3

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

sudo ifconfig eth0 down
sudo ifconfig eth0 up
ping google.com >> doesn't work > ping: connect: Network is unreachable
ping 8.8.8.8 >> doesn't work > ping: connect: Network is unreachable
ping 127.0.0.1 >> works

Expected Behavior

After sudo ifconfig eth0 down and sudo ifconfig eth0 up, the eth should work.

Actual Behavior

After sudo ifconfig eth0 down and sudo ifconfig eth0 up, the eth doesn't work as shown above.

Diagnostic Logs

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.210.220 netmask 255.255.240.0 broadcast 172.19.223.255
inet6 fe80::215:5dff:fe49:338a prefixlen 64 scopeid 0x20
ether 00:15:5d:49:33:80 txqueuelen 1000 (Ethernet)
RX packets 75 bytes 14548 (14.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 2180 (2.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 146 bytes 7640 (7.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 146 bytes 7640 (7.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

$ ping google.com
ping: connect: Network is unreachable
$ ping 8.8.8.8
ping: connect: Network is unreachable
$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.061 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.034 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1038ms
rtt min/avg/max/mdev = 0.034/0.047/0.061/0.013 ms

No response

Copy link

github-actions bot commented Sep 9, 2024

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@gigit0000
Copy link
Author

gigit0000 commented Sep 9, 2024

This is the log. It only happens when I command sudo ifconfig eth0 down and then sudo ifconfig eth0 up .

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.210.220 netmask 255.255.240.0 broadcast 172.19.223.255
inet6 fe80::215:5dff:fe49:338a prefixlen 64 scopeid 0x20
ether 00:15:5d:49:33:80 txqueuelen 1000 (Ethernet)
RX packets 75 bytes 14548 (14.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 2180 (2.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 146 bytes 7640 (7.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 146 bytes 7640 (7.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

$ ping google.com
ping: connect: Network is unreachable
$ ping 8.8.8.8
ping: connect: Network is unreachable
$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.061 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.034 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1038ms
rtt min/avg/max/mdev = 0.034/0.047/0.061/0.013 ms

@gigit0000 gigit0000 changed the title sudo ifconfig eth0 up doesn't work sudo ifconfig eth0 up doesn't bring up network Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@gigit0000
Copy link
Author

I only updated the title. That's my feedback.

@OneBlue
Copy link
Collaborator

OneBlue commented Sep 10, 2024

@gigit0000: This is by design, since WSL's network interfaces are configured by WSL itself (not by dhcp). If you disable an interface , it won't be able to automatically reconfigure itself when you enable it again.

@OneBlue OneBlue closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants