maxnet / berryboot

Berryboot -- Boot menu / OS installer
http://www.berryboot.com/
Other
803 stars 135 forks source link

MTU is not read from DHCP server. #224

Closed dnm2dnm closed 8 years ago

dnm2dnm commented 8 years ago

BerryBoot does not take MTU from DHCP.

Also would be nice to configure MTU manually but it is still possible to configure MTU from terminal. But! BerryBoot cannot recognize Alt-Ctrl-F2 from some portable keyboard.

dnm2dnm commented 8 years ago

Please be nice and respect MTU. Thank you!

dnm2dnm commented 8 years ago

If I install BerryBoot on /dev/sda1 then I am not able to change MTU at all. When I try to enter ifconfig it requests the password. What is the password? I cannot install berryboot in this environment at all. Please...

maxnet commented 8 years ago

What operating image are you using? Berryboot itself does not set any password, only need to enter the username root

dnm2dnm commented 8 years ago

I was using the image from http://downloads.sourceforge.net/project/berryboot/berryboot-20150916-pi2-only.zip

It was asking me a password right I was typing "ifconfig" after loged in. I was trying back and forth several times and once it allowed me to enter the command ifconfig eth0 mtu 1460

Now looks fine but if I will get something like that in the future then I will let you know.

Is it difficult to configure dhcpclient to take MTU from dhcpserver? I remember the same thing was in Android but there some guy deleted MTU option from dhcpclient config file. The guys fixed that issue in some of Android versions but now again it does not take MTU...

The normal dhcpclient.conf contents:

request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers, dhcp6.fqdn, dhcp6.sntp-servers;


Please verify if the option "interface-mtu" in your version of linux exists.

Best regards,

Dmitry


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Wed, Dec 30, 2015 at 11:12 PM, maxnet notifications@github.com wrote:

What operating image are you using? Berryboot itself does not set any password, only need to enter the username root

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168066709.

maxnet commented 8 years ago

It was asking me a password right I was typing "ifconfig" after loged in.

Sounds like you hit the "console" button more than once. Then more than one getty program is ran, and asks for username. If username is root it does not ask for password, but if username is something else -like ifconfig- it does.

Is it difficult to configure dhcpclient to take MTU from dhcpserver?

You would probably just have to alter the DHCP shell script that gets called after a DHCP lease is received/released and is responsible for calling ifconfig to configure the interface: https://github.com/maxnet/berryboot/blob/berryboot2015/buildroot-2015.02/package/busybox/udhcpc.script Never tried though, I never encountered a network that needed that.

dnm2dnm commented 8 years ago

I am not sure about keypressing because it was wifi keyboard anyway I will let you know if that was not the case and I will make the screen shot of my TV.

According to MTU: Looks like in your version of LInux DHCPCD is handled by BUSYBOX.

Original dhcpcd is here http://roy.marples.name/projects/dhcpcd/index

Where you may clearly see that the guy is respect MTU

Probably some fork commented MTU like this https://github.com/bldewolf/dhcpcd/blob/master/dhcpcd.conf

But this is VERY stupid comment because only network admin knows what should be.

And after that your version of busybox(original or fork BTW?) was written from the fork and disabled MTU support.

Unbelievable, look at the comment of the guy who forked dhcpcd!

Some interface drivers reset when changing the MTU so disabled by default.

Frankly, this sucks! The guy is out of understanding the network at all. If MTU changes I do not care about network drivers if they are not working!

So this terrible error comes from some BUSYBOX?

which one? We should stop and prevent such behavior.


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 2:09 AM, maxnet notifications@github.com wrote:

It was asking me a password right I was typing "ifconfig" after loged in.

Sounds like you hit the "console" button more than once. Then more than one getty program is ran, and asks for username. If username is root it does not ask for password, but if username is something else -like ifconfig- it does.

Is it difficult to configure dhcpclient to take MTU from dhcpserver?

You would probably just have to alter the DHCP shell script for that: https://github.com/maxnet/berryboot/blob/berryboot2015/buildroot-2015.02/package/busybox/udhcpc.script Never tried though, I never encountered a network that needed that.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168092260.

maxnet commented 8 years ago

Looks like in your version of LInux DHCPCD is handled by BUSYBOX.

Not sure where you are drawing that conclusion from, since there are a lot more DHCP clients than just dhcpcd on Linux.

The Busybox applet is based on udhcpc, and is only responsible for communicating with the DHCP server. It calls a shell script you need to provide yourself to do the actual configuration of the network interface.

If you think the shell script should set the mtu using ifconfig, change it to do so. I suspect the mtu value received from the DHCP server may be available as $mtu shell variable to it, but you would have to check.

dnm2dnm commented 8 years ago

If you will think in this way you will never boot up your workstation from network where MTU is setup less than default 1500.

https://git.busybox.net/busybox/tree/networking/udhcp/common.c?h=1_24_stable

MTU is not an option - it is a must. It must be configured by DHCP Client from DHCP Server

RTFM of RFC 2132 https://www.ietf.org/rfc/rfc2132.txt

http://www.networksorcery.com/enp/protocol/bootp/option026.htm

We are not windows guys... :)


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 4:37 AM, maxnet notifications@github.com wrote:

Looks like in your version of LInux DHCPCD is handled by BUSYBOX.

Not sure where you are drawing that conclusion from, since there are a lot more DHCP clients than just dhcpcd on Linux.

The Busybox applet is based on udhcpc, and is only responsible for communicating with the DHCP server. It calls a shell script you need to provide yourself to do the actual configuration of the network interface.

If you think the shell script should set the mtu using ifconfig, change it to do so. I suspect the mtu value received from the DHCP server may be available as $mtu shell variable to it, but you would have to check.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168108620.

dnm2dnm commented 8 years ago

If you will think in this way you will never boot up your workstation from network where MTU is setup less than default 1500.

https://git.busybox.net/busybox/tree/networking/udhcp/common.c?h=1_24_stable

MTU is not an option - it is a must. It must be configured by DHCP Client from DHCP Server

RTFM of RFC 2132 https://www.ietf.org/rfc/rfc2132.txt

http://www.networksorcery.com/enp/protocol/bootp/option026.htm

We are not windows guys... :)


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 4:37 AM, maxnet notifications@github.com wrote:

Looks like in your version of LInux DHCPCD is handled by BUSYBOX.

Not sure where you are drawing that conclusion from, since there are a lot more DHCP clients than just dhcpcd on Linux.

The Busybox applet is based on udhcpc, and is only responsible for communicating with the DHCP server. It calls a shell script you need to provide yourself to do the actual configuration of the network interface.

If you think the shell script should set the mtu using ifconfig, change it to do so. I suspect the mtu value received from the DHCP server may be available as $mtu shell variable to it, but you would have to check.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168108620.

maxnet commented 8 years ago

If you want this fixed, change the shell script and send me a pull request. I do not have any such network, and am not going to spend a day setting up a test environement.

dnm2dnm commented 8 years ago

That shell script does nothing with DHCP at all. I will try to discover what could be done here if possible at all...

I am trying to find where the problem comes from.

I do not ask you setup the network but this is very easy to tell DHCP Server set MTU to 1499 and watch if your client gets it. Because 1499 is less than 1500 it will not be harmful for the environment where 1500 is default.

Almost everybody who is dealing with xDSL operators have such problems. Look around. :) https://www.google.ru/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20change%20mtu


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 5:05 AM, maxnet notifications@github.com wrote:

If you want this fixed, change the shell script and send me a pull request. I do not have any such network, and am not going to spend a day setting up a test environement.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168110458.

dnm2dnm commented 8 years ago

BTW, it would be very nice if you will make in GUI setup to change MTU before making network access like SONY did in their PS3 :) Or maybe in some config file like you did for SCSI.

The other way to make the life easier for the guys who is using non standard MTU.

Anyway your bootloader is the best! Thanks a lot!


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 5:05 AM, maxnet notifications@github.com wrote:

If you want this fixed, change the shell script and send me a pull request. I do not have any such network, and am not going to spend a day setting up a test environement.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168110458.

maxnet commented 8 years ago

That shell script does nothing with DHCP at all.

The shell script gets executed by the dhcp client after it obtains a lease. The dhcp client passes all information it receives from the dhcp server to the shell script as environment variables. E.g. ip as $ip, netmask as $subnet Shell script then uses that to configure interface through ifconfig.

Try changing:

[ -n "$subnet" ] && NETMASK="netmask $subnet" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

To something like:

[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$mtu" ] && MTU="mtu $mtu" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK $MTU

Again, I cannot test things like that. Have a 200 mbit cable connection, not DSL. Do not receive any MTU. Cannot alter dhcp server settings, without setting up a seperate dhcp server in isolated testing environment.

dnm2dnm commented 8 years ago

The building process is still working. More than 3 hours !!!

I changed the script on live Raspberry PI 2 It is working ONLY if I run udhcpc -O mtu So also somewhere else has to be added request MTU by default.


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 5:45 AM, maxnet notifications@github.com wrote:

That shell script does nothing with DHCP at all.

The shell script gets executed by the dhcp client after it obtains a lease. The dhcp client passes all information it receives from the dhcp server to the shell script as environment variables. E.g. ip as $ip, netmask as $netmask Shell script then uses that to configure interface through ifconfig.

Try changing:

[ -n "$subnet" ] && NETMASK="netmask $subnet" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

To something like:

[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$mtu" ] && MTU="mtu $mtu" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK $MTU

Again, I cannot test things like that. Have a 200 mbit cable connection, not DSL. Do not receive any MTU.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168112720.

dnm2dnm commented 8 years ago

If you will look at the original BUSYBOX udhcpc/common.c you will see that MTU is enabled by default

{ OPTION_U16 , 0x1a }, /* DHCP_MTU */

So somebody removed that very vital option. Without this network will not work properly.


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 5:45 AM, maxnet notifications@github.com wrote:

That shell script does nothing with DHCP at all.

The shell script gets executed by the dhcp client after it obtains a lease. The dhcp client passes all information it receives from the dhcp server to the shell script as environment variables. E.g. ip as $ip, netmask as $netmask Shell script then uses that to configure interface through ifconfig.

Try changing:

[ -n "$subnet" ] && NETMASK="netmask $subnet" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

To something like:

[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$mtu" ] && MTU="mtu $mtu" .... /sbin/ifconfig $interface $ip $BROADCAST $NETMASK $MTU

Again, I cannot test things like that. Have a 200 mbit cable connection, not DSL. Do not receive any MTU.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168112720.

maxnet commented 8 years ago

If you will look at the original BUSYBOX udhcpc/common.c you will see that MTU is enabled by default

{ OPTION_U16 , 0x1a }, /* DHCP_MTU */

No, that merely makes the option available. Only options that are or'd with OPTION_REQ are requested by default.

Note that section "3.5 Client parameters in DHCP" of RFC 2131 only says that the client SHOULD always set the "maximum DHCP message size" option. It does not say the client SHOULD or MUST set the 'parameter request list', only that it can do so. So the client is free not to request any additional parameters like MTU.

Since it is not requested by default, you'll probably need to edit the busybox configuration to let ifup pass the right options to udhcpc. Probably just means editing this line: https://github.com/maxnet/berryboot/blob/berryboot2015/buildroot-2015.02/package/busybox/busybox.config#L889 But again, have not tested that.

dnm2dnm commented 8 years ago

Yes, you are right to work properly it is required to add OPTION_REQ or to put on command line -O mtu

MTU is the basic. I do not understand why you are trying to find the way to avoid it. There is no requirement to request IP Address itself. Why do you request it? :) Because your computer will not work? But it will not work with NOT correct MTU size also.

I tested and it was working in all the ways you spoke about.

It is a pity that Busybox guys did not care about MTU when implemented DHCPC. Really stupid things happen. And when we meet such guys we are going into troubles. I am not alone btw... :)

https://bugzilla.redhat.com/show_bug.cgi?id=566873

PS. I have 100Mbits/s connection and my provider(5M users apx) is using L2TP not xDSL where MTU is set to 1460


This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access,

review and disclosure by the sender's e-mail System Administrator.

On Thu, Dec 31, 2015 at 1:07 PM, maxnet notifications@github.com wrote:

If you will look at the original BUSYBOX udhcpc/common.c you will see that MTU is enabled by default

{ OPTION_U16 , 0x1a }, /* DHCP_MTU */

No, that merely makes the option available. Only options that are or'd with OPTION_REQ are requested by default.

Note that section "3.5 Client parameters in DHCP" of RFC 2131 only says that the client SHOULD always request the "maximum DHCP message size" option. It does not say the client SHOULD or MUST request any other option, like MTU.

Since it is not requested by default, you'll probably need to edit the busybox configuration to let ifup pass the right options to udhcpc. Probably just means editing this line: https://github.com/maxnet/berryboot/blob/berryboot2015/buildroot-2015.02/package/busybox/busybox.config#L889 But again, have not tested that.

— Reply to this email directly or view it on GitHub https://github.com/maxnet/berryboot/issues/224#issuecomment-168161119.

dnm2dnm commented 8 years ago

The screenshot that shows that after ifconfig it asks me for a password

On Thu, Dec 31, 2015 at 4:12 AM, D d@atsn.net wrote:

I am not sure about keypressing because it was wifi keyboard anyway I will let you know if that was not the case and I will make the screen shot of my TV.

On Thu, Dec 31, 2015 at 2:09 AM, maxnet notifications@github.com wrote:

It was asking me a password right I was typing "ifconfig" after loged in.

Sounds like you hit the "console" button more than once. Then more than one getty program is ran, and asks for username. If username is root it does not ask for password, but if username is something else -like ifconfig- it does.