Re: Network interface restart
> Op woensdag 09 mei 2007, schreef Sam Lawrance: > > Hi, > >> > Could someone please point out where I made the mistake? >> >> When your network interface went down, you lost the connection, your >> shell lost the terminal and your script was terminated before it >> could finish doing what it was supposed to. Possibly you need to use >> something like "nohup" or "screen" (from ports), or have some other >> form of terminal available. > > Thanks for your answer. > > But as I said, I ran the script from a screen session, so that makes me > wonder why the execution was aborted. Sorry, I missed that you were already using screen. Now I'm wondering too :-) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
>> But as I said, I ran the script from a screen session, so that makes me >> wonder >> why the execution was aborted. >> >> But is running '/etc/rc.d/netif restart'' known to cause problems? I think >> I >> shouldn't have to use scripts like these just to change a setting on the >> network interface. >> >> Kind regards, >> >> -- >> Bram Schoenmakers >> > > Hi Bram > > You're exactly right. You don't need to run scripts like this. "ifconfig" > will do what you want. As far as I can see, > > "ifconfig bge0 mtu 1472" > > should suffice. I like the ifconfig idea better, as per the routing. I don't know but does netif also drop firewall state rules? This should work well 'just in case' while running in a screen. If you get no response after running it, it'll put it back the way it was before. If you do get a response, you can send the process a ^C during sleep(): #!/bin/sh ifconfig bge0 mtu 1472 sleep 5 ifconfig bge0 mtu 1500 Steve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
On Wed, May 09, 2007, Bram Schoenmakers wrote: > But as I said, I ran the script from a screen session, so that makes me > wonder > why the execution was aborted. > > But is running '/etc/rc.d/netif restart'' known to cause problems? I think I > shouldn't have to use scripts like these just to change a setting on the > network interface. First, you should limit the operation to the interface in question. You can do this by adding the interface name as optional parameter. Nevertheless, any routing information regarding this interface gets dropped, in your case it most probably the interface of the default gateway. So, your interface will come back, but will be reachable only in its subnet. Something like | # /etc/rc.d/netif restart bge0 && /etc/rc.d/routing restart in a screen session should do the trick. -cs ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
> Op woensdag 09 mei 2007, schreef Sam Lawrance: > > Hi, > > > > Could someone please point out where I made the mistake? > > > > When your network interface went down, you lost the connection, your > > shell lost the terminal and your script was terminated before it > > could finish doing what it was supposed to. Possibly you need to use > > something like "nohup" or "screen" (from ports), or have some other > > form of terminal available. > > Thanks for your answer. > > But as I said, I ran the script from a screen session, so that makes me > wonder > why the execution was aborted. > > But is running '/etc/rc.d/netif restart'' known to cause problems? I think > I > shouldn't have to use scripts like these just to change a setting on the > network interface. > > Kind regards, > > -- > Bram Schoenmakers > Hi Bram You're exactly right. You don't need to run scripts like this. "ifconfig" will do what you want. As far as I can see, "ifconfig bge0 mtu 1472" should suffice. Cheers, Benjamin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
Bram Schoenmakers wrote: > Op woensdag 09 mei 2007, schreef Sam Lawrance: > > Hi, > >>> Could someone please point out where I made the mistake? >> When your network interface went down, you lost the connection, your >> shell lost the terminal and your script was terminated before it >> could finish doing what it was supposed to. Possibly you need to use >> something like "nohup" or "screen" (from ports), or have some other >> form of terminal available. > > Thanks for your answer. > > But as I said, I ran the script from a screen session, so that makes me > wonder > why the execution was aborted. > > But is running '/etc/rc.d/netif restart'' known to cause problems? I think I > shouldn't have to use scripts like these just to change a setting on the > network interface. More importantly, what *exactly* did your 'fallback' script contain? Steve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
Op woensdag 09 mei 2007, schreef Sam Lawrance: Hi, > > Could someone please point out where I made the mistake? > > When your network interface went down, you lost the connection, your > shell lost the terminal and your script was terminated before it > could finish doing what it was supposed to. Possibly you need to use > something like "nohup" or "screen" (from ports), or have some other > form of terminal available. Thanks for your answer. But as I said, I ran the script from a screen session, so that makes me wonder why the execution was aborted. But is running '/etc/rc.d/netif restart'' known to cause problems? I think I shouldn't have to use scripts like these just to change a setting on the network interface. Kind regards, -- Bram Schoenmakers BOFH Excuse #8: static buildup ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Network interface restart
On 09/05/2007, at 8:31 PM, Bram Schoenmakers wrote: Hi, I tried to reduce the MTU of a network interface on a remote FreeBSD 6.2 machine. So that means changing this line in rc.conf: ifconfig_bge0="inet xxx.xxx.xxx.xxx netmask 255.255.255.128" to ifconfig_bge0="inet xxx.xxx.xxx.xxx netmask 255.255.255.128 mtu 1472" Of course, there's a real IP address set. Then, I tried to restart the network interface: /etc/rc.d/netif restart which went horribly wrong. I lost connection and wasn't able to reconnect. I tried to run this in some 'fallback' script, which automatically should restore the old configuration and restarting the network interface again after 5 minutes. Even if that failed, it should reboot the machine. But somehow the script was aborted, although I ran it in a 'screen' session over SSH. So the last resort was a manual reboot, which started the interface with MTU 1472 just fine. Could someone please point out where I made the mistake? When your network interface went down, you lost the connection, your shell lost the terminal and your script was terminated before it could finish doing what it was supposed to. Possibly you need to use something like "nohup" or "screen" (from ports), or have some other form of terminal available. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"