Linux/Ubuntu2016. 10. 5. 18:18

dhclient.conf에서 lease를 이용하면 된다고 한다.


timeout 10;

lease {

interface "eth0";

fixed-address 10.0.0.10;

option subnet-mask 255.255.255.0;

renew 2 2022/1/1 00:00:01;

rebind 2 2022/1/1 00:00:01;

expire 2 2022/1/1 0:00:01;


or you can assign a second IP to the interface like /etc/network/interfaces


auto lo

iface lo inet loopback

iface eth0 inet dhcp


auto eth0:1

iface eth0:1 inet static

address 10.10.10.2

netmask 255.255.255.0

[링크 : http://stackoverflow.com/questions/12727175/set-static-ip-if-not-obtained-from-dhcp-script]


The timeout statement


timeout time ;


The timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the time that it decides that it's not going to be able to contact a server. By default, this timeout is sixty seconds. After the timeout has passed, if there are any static leases defined in the configuration file, or any leases remaining in the lease database that have not yet expired, the client will loop through these leases attempting to validate them, and if it finds one that appears to be valid, it will use that lease's address. If there are no valid static leases or unexpired leases in the lease database, the client will restart the protocol after the defined retry interval.Lease Declarations



The lease declaration


lease { lease-declaration [ ... lease-declaration ] }


The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is not going to succeed in contacting a server. At that time, it consults its own database of old leases and tests each one that has not yet timed out by pinging the listed router for that lease to see if that lease could work. It is possible to define one or more fixed leases in the client configuration file for networks where there is no DHCP or BOOTP service, so that the client can still automatically configure its address. This is done with the lease statement.


NOTE: the lease statement is also used in the dhclient.leases file in order to record leases that have been received from DHCP servers. Some of the syntax for leases as described below is only needed in the dhclient.leases file. Such syntax is documented here for completeness.


A lease statement consists of the lease keyword, followed by a left curly brace, followed by one or more lease declaration statements, followed by a right curly brace. The following lease declarations are possible:

[링크 : https://linux.die.net/man/5/dhclient.conf]


odroid 설정파일

$ vi /etc/dhcp/dhclient.conf

# Configuration file for /sbin/dhclient, which is included in Debian's

#       dhcp3-client package.

#

# This is a sample configuration file for dhclient. See dhclient.conf's

#       man page for more information about the syntax of this file

#       and a more comprehensive list of the parameters understood by

#       dhclient.

#

# Normally, if the DHCP server provides reasonable information and does

#       not leave anything out (like the domain name, for example), then

#       few changes must be made to this file, if any.

#


option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;


#send host-name "andare.fugue.com";

send host-name = gethostname();

#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;

#send dhcp-lease-time 3600;

#supersede domain-name "fugue.com home.vix.com";

#prepend domain-name-servers 127.0.0.1;

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;

#require subnet-mask, domain-name-servers;

#timeout 60;

#retry 60;

#reboot 10;

#select-timeout 5;

#initial-interval 2;

#script "/etc/dhcp3/dhclient-script";

#media "-link0 -link1 -link2", "link0 link1";

#reject 192.33.137.209;


#alias {

#  interface "eth0";

#  fixed-address 192.5.5.213;

#  option subnet-mask 255.255.255.255;

#}


#lease {

#  interface "eth0";

#  fixed-address 192.33.137.200;

#  medium "link0 link1";

#  option host-name "andare.swiftmedia.com";

#  option subnet-mask 255.255.255.0;

#  option broadcast-address 192.33.137.255;

#  option routers 192.33.137.250;

#  option domain-name-servers 127.0.0.1;

#  renew 2 2000/1/12 00:00:01;

#  rebind 2 2000/1/12 00:00:01;

#  expire 2 2000/1/12 00:00:01;

#} 


어? odroid에 해봤는데 안되네.. 머지??!?!

아무튼.. dhcp는 link가 탐지되어야 하니 최소한 랜은 꽂혀서 hub에 연결은 되어야 dhcp client가 가동된다.


+

$ sudo vi /etc/dhcp/dhclient-enter-hooks.d/debug

RUN="yes"

                                echo "$var='${!var}'" >> /tmp/dhclient-script.debug 


[링크 : https://lists.debian.org/debian-user/2010/10/msg00375.html]

위의 내용을 바꾸면 /tmp/dhclient-script.debug 에 로그가 쌓이는데


Wed Oct 5 21:23:43 KST 2016: entering /sbin, dumping variables.

reason='PREINIT'

interface='eth0'

--------------------------

Wed Oct 5 21:23:54 KST 2016: entering /sbin, dumping variables.

reason='FAIL'

interface='eth0'

--------------------------

Wed Oct 5 21:24:10 KST 2016: entering /sbin, dumping variables.

reason='PREINIT'

interface='eth0'

--------------------------

Wed Oct 5 21:24:11 KST 2016: entering /sbin, dumping variables.

reason='TIMEOUT'

interface='eth0'

new_ip_address='192.168.219.130'

new_network_number='192.168.219.0'

new_subnet_mask='255.255.255.0'

new_broadcast_address='192.168.219.255'

new_routers='192.168.219.1'

new_domain_name_servers='1.214.68.2 61.41.153.2'

--------------------------

Wed Oct 5 21:24:14 KST 2016: entering /sbin, dumping variables.

reason='FAIL'

interface='eth0'

--------------------------

Wed Oct 5 21:27:14 KST 2016: entering /sbin, dumping variables.

reason='FAIL'

interface='eth0'

--------------------------

Wed Oct 5 21:27:40 KST 2016: entering /sbin, dumping variables.

reason='PREINIT'

interface='eth0'

--------------------------

Wed Oct 5 21:27:41 KST 2016: entering /sbin, dumping variables.

reason='BOUND'

interface='eth0'

new_ip_address='192.168.219.130'

new_network_number='192.168.219.0'

new_subnet_mask='255.255.255.0'

new_broadcast_address='192.168.219.255'

new_routers='192.168.219.1'

new_domain_name_servers='1.214.68.2 61.41.153.2'

old_ip_address='192.168.219.130'

old_network_number='192.168.219.0'

old_subnet_mask='255.255.255.0'

old_broadcast_address='192.168.219.255'

old_routers='192.168.219.1'

old_domain_name_servers='1.214.68.2 61.41.153.2'

-------------------------- 


운 좋게(?) timeout 한번나서 설정되었지만.. 내가 의도한 녀석은 아니고..

정상적으로 dhcp를 통해 받아와서야 BOUND로 표기되었다...

lease는 그냥 timeout 인건가.. 아니면 timeout을 길게줘야하나?



내용에 의하면.. 내가 원하는... DHCP 값을 못 받아 올 경우

기본 값으로 설정하는 용도로는 맞지 않다는 거군....

Expire

The DHCP client has failed to renew its lease or acquire a new one, and the lease has expired. The IP address must be relinquished, and all related parameters should be deleted, as in RENEW and REBIND.


Fail

The DHCP client has been unable to contact any DHCP servers, and any leases that have been tested have not proved to be valid. The parameters from the last lease tested should be deconfigured. This can be handled in the same way as EXPIRE.


Timeout

The DHCP client has been unable to contact any DHCP servers. However, an old lease has been identified, and its parameters have been passed in as with BOUND. The client configuration script should test these parameters and, if it has reason to believe they are valid, should exit with a value of zero. If not, it should exit with a nonzero value.

The usual way to test a lease is to set up the network as with REBIND (since this may be called to test more than one lease) and then ping the first router defined in $routers. If a response is received, the lease must be valid for the network to which the interface is currently connected. It would be more complete to try to ping all of the routers listed in $new_routers, as well as those listed in $new_static_routes, but current scripts do not do this.


[링크 : https://linux.die.net/man/8/dhclient-script]

[링크 : https://www.freebsd.org/cgi/man.cgi?dhclient-script(8)]


[링크 : http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian]

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu php4 설치  (0) 2016.10.06
ubuntu apt를 통해 자동 업데이트 되지 않도록 하기  (0) 2016.10.05
proprietary driver on lubuntu  (0) 2016.09.09
gnome-disks 벤치마크  (0) 2016.09.05
lynx 마우스 사용하기  (0) 2016.08.18
Posted by 구차니
Linux2016. 9. 21. 11:35

해보니 nm은 strip 된건 안되고 objdump랑 readelf는 된다.

함수 목록 보기에는 유용 한 듯


$ nm -gC yourLib.so

$ objdump -TC libz.so

$ readelf -Ws libz.so


[링크 : http://stackoverflow.com/questions/34732/how-do-i-list-the-symbols-in-a-so-file]

'Linux' 카테고리의 다른 글

파티션 label 변경하기  (0) 2016.10.15
구버전 사용시 호환(?)  (0) 2016.10.12
sysbench  (0) 2016.09.04
grep --exclude-dir  (0) 2016.07.09
nptl - Native POSIX Threads Library  (0) 2016.06.27
Posted by 구차니
Linux/Ubuntu2016. 9. 9. 20:31

lxde 라고 별건 없고 그냥

시스템 쪽에 업데이트 실행해서 독점 드라이버 탭에서 하면되는데

안뜨네...


[링크 : http://askubuntu.com/questions/197110/enable-drivers-on-lubuntu]

Posted by 구차니
Linux/Ubuntu2016. 9. 5. 21:01

디스크 성능 테스트 용


[링크 : http://askubuntu.com/questions/249310/how-can-i-launch-disk-utility-after-installing-it]

'Linux > Ubuntu' 카테고리의 다른 글

dhcp 받아오기 실패시 static ip로 설정하기 (timeout 시)  (0) 2016.10.05
proprietary driver on lubuntu  (0) 2016.09.09
lynx 마우스 사용하기  (0) 2016.08.18
axel  (0) 2016.08.18
baobab - Disk Usage Analyzer  (0) 2016.06.13
Posted by 구차니
Linux2016. 9. 4. 10:19

시스템 벤치마크용 툴

cpu / io / mysql  등으로 테스트 가능한 듯?


[링크 : https://www.howtoforge.com/how-to-benchmark-your-system-cpu-file-io-mysql-with-sysbench]]

[링크 : http://faq.hostway.co.kr/Linux_ETC/7162]


'Linux' 카테고리의 다른 글

구버전 사용시 호환(?)  (0) 2016.10.12
strip 된 so 파일의 symbol 보기  (0) 2016.09.21
grep --exclude-dir  (0) 2016.07.09
nptl - Native POSIX Threads Library  (0) 2016.06.27
cp -Lr  (0) 2016.06.14
Posted by 구차니
Linux/Ubuntu2016. 8. 18. 20:23

좌 클릭은 이동

우 클릭은 이전 페이지로 이동


$ lynx -use_mouse

[링크 : http://linux.die.net/man/1/lynx]

'Linux > Ubuntu' 카테고리의 다른 글

proprietary driver on lubuntu  (0) 2016.09.09
gnome-disks 벤치마크  (0) 2016.09.05
axel  (0) 2016.08.18
baobab - Disk Usage Analyzer  (0) 2016.06.13
*.so 파일의 의존성 확인하기  (0) 2016.06.13
Posted by 구차니
Linux/Ubuntu2016. 8. 18. 19:56

wget보다 빠른 녀석인 듯?

$ sudo apt-cache search wget

abcde - A Better CD Encoder

axel - light download accelerator - console version

axel-dbg - light download accelerator - debugging symbols

devscripts - scripts to make the life of a Debian Package maintainer easier

filetea - Web-based file sharing system

libcupt3-0-downloadmethod-wget - flexible package manager -- wget download method

ow-shell - shell utilities to talk to an 1-Wire owserver

puf - Parallel URL fetcher

pwget - downloader utility which resembles wget (implemented in Perl)

snarf - A command-line URL grabber

texlive-latex-extra - TeX Live: LaTeX additional packages

wget - retrieves files from the web

wget-el - interface for wget on Emacsen

wput - tiny wget-like ftp-client for uploading files 


$ wget http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso?_ga=1.59634341.941728734.1471518637

--2016-08-18 20:13:20--  http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso?_ga=1.59634341.941728734.1471518637

Resolving releases.ubuntu.com (releases.ubuntu.com)... 91.189.88.148, 2001:67c:1360:8c01::1e

Connecting to releases.ubuntu.com (releases.ubuntu.com)|91.189.88.148|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1513308160 (1.4G) [application/x-iso9660-image]

Saving to: ‘ubuntu-16.04.1-desktop-amd64.iso?_ga=1.59634341.941728734.1471518637’


esktop-amd64.iso?_g   3%[                      ]  46.40M  2.48MB/s   eta 13m 18s

속도가 오를때 마다 줄이 넘어가서 일단 삭제하고..

아무튼 wget 보다는 빠르다.

$ axel http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso?_ga=1.59634341.941728734.1471518637

Initializing download: http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso?_ga=1.59634341.941728734.1471518637

File size: 1513308160 bytes

Opening output file ubuntu-16.04.1-desktop-amd64.iso

Starting download


[  0%]  .......... .......... .......... .......... ..........  [  91.7KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2151.5KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2164.4KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2177.7KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2190.9KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2203.9KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2217.0KB/s]

[  0%]  .......... .......... .......... .......... ..........  [2230.6KB/s]

[  1%]  .......... .......... .......... .......... ..........  [3247.9KB/s]

[  1%]  .......... .......... .......... .......... ..........  [3249.8KB/s]

[  1%]  .......... .......... ..........^C .

Downloaded 18.3 megabytes in 5 seconds. (3250.80 KB/s) 


'Linux > Ubuntu' 카테고리의 다른 글

gnome-disks 벤치마크  (0) 2016.09.05
lynx 마우스 사용하기  (0) 2016.08.18
baobab - Disk Usage Analyzer  (0) 2016.06.13
*.so 파일의 의존성 확인하기  (0) 2016.06.13
우분투 버전별 리눅스 커널  (4) 2016.06.09
Posted by 구차니
Linux2016. 7. 9. 11:09


$ grep --exclude-dir=".svn"

[링크 : http://stackoverflow.com/questions/1491514/exclude-svn-directories-from-grep]


svn 관리용 디렉토리 무시하니 편하네

'Linux' 카테고리의 다른 글

strip 된 so 파일의 symbol 보기  (0) 2016.09.21
sysbench  (0) 2016.09.04
nptl - Native POSIX Threads Library  (0) 2016.06.27
cp -Lr  (0) 2016.06.14
libxml 크로스컴파일. (shared library)  (0) 2016.06.13
Posted by 구차니
Linux2016. 6. 27. 20:44

getconf는 설정값을 불러오는건데.. 시스템인가 커널인가.. 그건 찾아 봐야 할듯

[링크 : http://linux.die.net/man/1/getconf]



$ getconf GNU_LIBPTHREAD_VERSION

NPTL 2.3.4

[링크 : https://kldp.org/node/107186]

[링크 : http://man7.org/linux/man-pages/man7/nptl.7.html]

'Linux' 카테고리의 다른 글

sysbench  (0) 2016.09.04
grep --exclude-dir  (0) 2016.07.09
cp -Lr  (0) 2016.06.14
libxml 크로스컴파일. (shared library)  (0) 2016.06.13
chvt - change Virtual Termianl  (0) 2016.04.12
Posted by 구차니
Linux2016. 6. 14. 09:28

심볼릭링크 가 귀찮을때! (헤더가 죄다 심볼릭 링크라던가?)

그냥 원본을 복사하는 방법


      -L, --dereference

              always follow symbolic links in SOURCE


[링크 : http://superuser.com/questions/216919/how-to-copy-symlinks-to-target-as-normal-folders]

'Linux' 카테고리의 다른 글

grep --exclude-dir  (0) 2016.07.09
nptl - Native POSIX Threads Library  (0) 2016.06.27
libxml 크로스컴파일. (shared library)  (0) 2016.06.13
chvt - change Virtual Termianl  (0) 2016.04.12
리눅스 콘솔에서 한글보기  (0) 2016.04.11
Posted by 구차니