В меморизз.
Взято отсюда: http://www.debuntu.org/how-to-set-up-a-serial-console-on-debian
How-To set up a serial console on Debian
This tutorial will go over the steps to go through in order to set up a serial console on Debian Linux.
Debian uses sysvinit to handle the booting process, amongst the different task, and as such, there is a few differences between most of the tutorial that you might find on the internet regarding how to set up a serial console.
A Serial Console becomes handy when running a headless server (i.e no keyboard and screen) or if you cannot connect a a server because of a network issue.
In this tutorial, we will set up a serial console on the server, the machine we want an access to. Setting up a serial console client will be covered in another article.
1. Checking the serial devices
In order to find which devices are available on a box, you can run:
$ dmesg | grep tty
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
From this output, we can guess that there is 2 serial interface2 (/dev/ttyS0 and /dev/ttyS1). This tutorial considers that you are using device 1 (ttyS0), if you use the second device, you will need to change ttyS0 by ttyS1.
2. Setting up the serial console on the server
On the server, we are going to set up:
A serial console on ttyS0
Have kernel booting messages output to the serial console
Make Grub outputs to the serial console
2.1. The serial console
To set up a serial console, We need to edit the file called /etc/inittab in order to spawn a getty on the serial device. getty will take care of prompting the user for a username and password.
Go and edit /etc/inittab and add:
s0:2345:respawn:/sbin/getty -L 115200 ttyS0 vt102
just below:
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
Now, run:
# init q
In order to have sysvinit re-read its configuration and spawn a getty on /dev/ttyS0 .
To authorize root to log in through the serial console, you need to edit /etc/securetty and make sure you have:
ttyS0
2.2. Having grub outputting to ttyS0
grub can be configured to output on the serial console.Edit grub and add:
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
In the section before the different kernels. This will take care of having grub being displayed one the serial console so you can actually modify grub through the serial console or boot using another kernel.
If using ttyS1, then change it to --unit=1
Also, in order to get the booting messages outputted to the serial console, you can append to your kernel line the following:
console=ttyS0,115200n8 console=tty0
So, finally, the kernel line will look like:
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/sda1 ro console=ttyS0,115200n8 console=tty0
That's it, upon next reboot, you will be able to connect directly to your box using a serial console!.
По факту для быстрого включения консоли можно выполнить (работает и в Ubuntu):
sudo getty -L 115200 ttyS0 vt102 &
понедельник, 27 февраля 2012 г.
пятница, 17 февраля 2012 г.
Cisco ISR архивирование конфига (версионность).
В мемориз!
Взято отсюда:
https://supportforums.cisco.com/videos/2715
#
mkdir CONFIG_ARCHIVE
conf t
archive
path flash:CONFIG_ARCHIVE/RUN_CONFIG
! Путь к каталогу, где будут архивные копии конфигов (к ним автоматом будут добавляться номера)
write-memory
! Добавление конфига в архив происходит при каждом сохранении конфига в старт (wr mem)
maximum 10
! Сохраняется количество версий - 14 - максимально
!Здесь же в настройках есть опции rollback
!rollback retry timeout ?
! <0-1000> Timeout value in seconds
#
dir flash:/CONFIG_ARCHIVE/
more flash:/CONFIG_ARCHIVE/RUN_CONFIG-1
! просмотр сохраненного конфига
archive config
! явное указание бэкапа конфига
show archive
config replace flash:/CONFIG_ARCHIVE/RUN_CONFIG-1
! Процедура rollback'а - отката на указанный вариант конфига
Взято отсюда:
https://supportforums.cisco.com/videos/2715
#
mkdir CONFIG_ARCHIVE
conf t
archive
path flash:CONFIG_ARCHIVE/RUN_CONFIG
! Путь к каталогу, где будут архивные копии конфигов (к ним автоматом будут добавляться номера)
write-memory
! Добавление конфига в архив происходит при каждом сохранении конфига в старт (wr mem)
maximum 10
! Сохраняется количество версий - 14 - максимально
!Здесь же в настройках есть опции rollback
!rollback retry timeout ?
! <0-1000> Timeout value in seconds
#
dir flash:/CONFIG_ARCHIVE/
more flash:/CONFIG_ARCHIVE/RUN_CONFIG-1
! просмотр сохраненного конфига
archive config
! явное указание бэкапа конфига
show archive
config replace flash:/CONFIG_ARCHIVE/RUN_CONFIG-1
! Процедура rollback'а - отката на указанный вариант конфига
вторник, 14 февраля 2012 г.
Передача файлов через консоль (xmodem, ymodem).
Не помню, где взял..., но в меморизз:
Uploading files with xmodem
PuTTy on Windows does not support zmodem, xmodem, etc. so I often used HyperTerminal, but the GUI of Hyperterminal annoys me.
So instead of switching between PuTTy and HyperTerminal all the time, I tried to use a different terminal emulator ‘TeraTerm Pro’. This seems fine, but for some reason it dumps a few random characters on the serial line after the file is transferred, falsely answering the multiple choice menu to decide between runtime, diag, multiple image or loader.
I am now using GNU Screen with lrzsz. It was a little struggle to figure out the correct syntax for this, because Screen has a google-incompatible name. Hopefully I’ve sprinkled enough relevant terms in this post to help somebody else with this issue.
I start screen with ‘screen /dev/ttyUSB0 115200′. Then when I start the Xmodem download on the bootrom side I execute CTRL-A “:exec !! sx -kb firmware.bix” in screen.
This works mostly fine. It eats the multiple choice menu after the transfer, but you can press to view it again. And FYI, the bootrom support Xmodem-1K giving a nice transferboost over regular Xmodem.
---
i have write my doc from youre.
*********************
Attention a etre raccordé sur le bon switch en cas de stack
*********************
screen /dev/ttyUSB0
enable
conf t
line con 0
speed 115200
CTRL A + k
screen /dev/ttyUSB0 115200
exit
exit
copy ymodem: flash:filename.bin
CTRL A puis :exec sz -kb filename.bin
Uploading files with xmodem
PuTTy on Windows does not support zmodem, xmodem, etc. so I often used HyperTerminal, but the GUI of Hyperterminal annoys me.
So instead of switching between PuTTy and HyperTerminal all the time, I tried to use a different terminal emulator ‘TeraTerm Pro’. This seems fine, but for some reason it dumps a few random characters on the serial line after the file is transferred, falsely answering the multiple choice menu to decide between runtime, diag, multiple image or loader.
I am now using GNU Screen with lrzsz. It was a little struggle to figure out the correct syntax for this, because Screen has a google-incompatible name. Hopefully I’ve sprinkled enough relevant terms in this post to help somebody else with this issue.
I start screen with ‘screen /dev/ttyUSB0 115200′. Then when I start the Xmodem download on the bootrom side I execute CTRL-A “:exec !! sx -kb firmware.bix” in screen.
This works mostly fine. It eats the multiple choice menu after the transfer, but you can press
---
i have write my doc from youre.
*********************
Attention a etre raccordé sur le bon switch en cas de stack
*********************
screen /dev/ttyUSB0
enable
conf t
line con 0
speed 115200
CTRL A + k
screen /dev/ttyUSB0 115200
exit
exit
copy ymodem: flash:filename.bin
CTRL A puis :exec sz -kb filename.bin
Маршруты в HP-UX
Взято отсюда: http://www.cyberciti.biz/tips/hp-ux-how-do-i-configure-routing-or-add-route.html
HP-UX: How Do I configure routing or add route?
by LinuxTitli on October 29, 2005
You can use route command to configure routing. Syntax is as follows:
route add net {network-address} netmask {subnet} {router-address}
Let us assume your router address is 192.168.1.254 and network ID is 192.168.1.0/24, then you can type route command as follows:
# route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.254
OR
To add a default route:
# route add default 192.168.1.254
Verify that (display) routing table is updated (display routing table):
# netstat -nr
Test it i.e. try to ping or send nslookup request:
# ping mycorp.com
To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f
However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file - /etc/rc.config.d/netconf. To add default router/gateway 192.168.1.254:
# vi /etc/rc.config.d/netconf
Add or modify following entries
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
Reboot HP-UX system/server to take effect
# shutdown -ry 0
HP-UX: How Do I configure routing or add route?
by LinuxTitli on October 29, 2005
You can use route command to configure routing. Syntax is as follows:
route add net {network-address} netmask {subnet} {router-address}
Let us assume your router address is 192.168.1.254 and network ID is 192.168.1.0/24, then you can type route command as follows:
# route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.254
OR
To add a default route:
# route add default 192.168.1.254
Verify that (display) routing table is updated (display routing table):
# netstat -nr
Test it i.e. try to ping or send nslookup request:
# ping mycorp.com
To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f
However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file - /etc/rc.config.d/netconf. To add default router/gateway 192.168.1.254:
# vi /etc/rc.config.d/netconf
Add or modify following entries
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
Reboot HP-UX system/server to take effect
# shutdown -ry 0
Подписаться на:
Сообщения (Atom)