|
|
在axm上dump包,然后重启k2a(192.168.253.12),可以dump到dhcp(bootp)的包
5 C1 \8 `/ C* }% D
$ b8 u6 P. U: |toor@server:~# tcpdump -i k2a -ne ##k2a是server端上连接client的接口/ B! d* K! i* n+ |5 J. }
tcpdump: WARNING: k2a: no IPv4 address assigned
% b* M' ~# ~ z! E/ Ktcpdump: verbose output suppressed, use -v or -vv for full protocol decode
1 Z. Y+ n2 j$ Llistening on k2a, link-type EN10MB (Ethernet), capture size 65535 bytes
! C; _# K' G) h: ~# [- k% `04:25:16.517103 b4:99:4c:b8:6f:69(clinet MAC) > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342:0.0.0.0.68 >255.255.255.255.67: BOOTP/DHCP, Request from b4:99:4c:b8:6f:69, length300 ##(见tcp/ip详解卷1,第16章). 68是client用端口,67是server用端口. client事先没有IP,所以client的bootp包中设置源ip是0.0.0.0( G: p# l" Z$ x8 o. d, @, w; B# w8 r
04:25:16.517349 02:40:43:77:07:01(server MAC) > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 342: 192.168.253.9.67 >192.168.253.12.68: BOOTP/DHCP, Reply, length 300 ## server端给client分配了IP为192.168.253.12,并reply给client端
: z+ O( ?. E9 i) B04:25:16.517613 b4:99:4c:b8:6f:69(client MAC) > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 64: Request who-has 192.168.253.9 tell 192.168.253.12, length 50 ##client要发送arp包得到server端MAC地址 _, M& Z: B: `1 _* P
04:25:16.517641 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype ARP (0x0806), length 42: Reply 192.168.253.9 is-at 02:40:43:77:07:01, length 287 P: q* L8 M& V- M3 r
04:25:16.517751 b4:99:4c:b8:6f:69(client MAC) > 02:40:43:77:07:01(server MAC), ethertype IPv4 (0x0800), length 65: 192.168.253.12.1234 > 192.168.253.9.69: 23 RRQ "u-boot-eth.bin" octet ##client端发送TFTP请求从server段读取client所需的引导文件(下面block 1~355)% j7 s$ X) v3 g4 V
04:25:16.645200 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 1
5 s0 N- Z! a; o; h04:25:16.645429 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 18 s3 B# c, n! N9 s3 u8 Y& a
04:25:16.650059 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 2+ A' `# d" g% \
04:25:16.650281 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 2; L2 G" J4 b9 J0 J
04:25:16.653322 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 3( [5 o6 G9 z2 s9 F: l8 @1 w
04:25:16.653543 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 3
+ q; T9 D- a4 j# ~$ _... ...% h7 Q6 z8 Q, T4 M6 W+ h' G
09:46:29.947034 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 352- P* a$ c% Y6 ?* s
09:46:29.947241 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 352' a) H2 m3 b H4 j$ q) w
09:46:29.947297 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 3533 E8 q2 J1 @. P" L
09:46:29.947504 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 353
, c1 t: f6 g) A2 F; s09:46:29.947552 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 558: 192.168.253.9.69 > 192.168.253.12.1234: 516 DATA block 3544 W' Q! {. \* B" W& s
09:46:29.947759 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 354
& v$ i P) L0 ^" e* R7 G09:46:29.947825 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 277: 192.168.253.9.69 > 192.168.253.12.1234: 235 DATA block 3553 M( L! p x) V) D) t
09:46:29.947997 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 64: 192.168.253.12.1234 > 192.168.253.9.69: 4 ACK block 355' ]* c3 \! `( I, Z. y
09:46:34.647872 b4:99:4c:b8:6f:69 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 303: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:99:4c:b8:6f:69, length 261; E9 h( i3 f; _, C# u" v% ?
09:46:34.648098 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 342: 192.168.253.9.67 > 192.168.253.12.68: BOOTP/DHCP, Reply, length 3004 i+ L: Z$ C2 }# q. q9 j! f9 F
09:46:34.648213 b4:99:4c:b8:6f:69 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 315: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:99:4c:b8:6f:69, length 273
/ `& e. E7 y2 B1 s! ?; H09:46:34.649072 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 342: 192.168.253.9.67 > 192.168.253.12.68: BOOTP/DHCP, Reply, length 300
% _5 w# |. E3 y* V09:46:34.947189 b4:99:4c:b8:6f:69 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 192.168.253.9 tell 192.168.253.12, length 46& S. i* A* P* \5 Z
09:46:34.947215 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype ARP (0x0806), length 42: Reply 192.168.253.9 is-at 02:40:43:77:07:01, length 28
2 \3 E/ B F( v09:46:34.947360 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 98: 192.168.253.12.1000 > 192.168.253.9.111: UDP, length 56) r' z- e1 S" q! C- `" W* c8 T
09:46:34.947512 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 70: 192.168.253.9.111 > 192.168.253.12.1000: UDP, length 288 Y0 M; U# @4 e
09:46:34.947616 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 98: 192.168.253.12.1000 > 192.168.253.9.111: UDP, length 566 s9 c( X; I; y: o9 \: V4 r" O
09:46:34.947710 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 70: 192.168.253.9.111 > 192.168.253.12.1000: UDP, length 280 @: P) i/ ? X) S* f3 E
09:46:34.947829 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 122: 192.168.253.12.1000 > 192.168.253.9.48232: UDP, length 801 }- Q3 [% G& s
09:46:34.949267 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 102: 192.168.253.9.48232 > 192.168.253.12.1000: UDP, length 60
7 U$ u8 g0 c7 l, n09:46:34.949408 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 150: 192.168.253.12.4 > 192.168.253.9.2049: 108 lookup fh Unknown/0100010101000000C30000000000000000000000000000000000000000000000 "skern.bin"0 v# c: c+ [5 q7 x
09:46:34.949711 02:40:43:77:07:01 > b4:99:4c:b8:6f:69, ethertype IPv4 (0x0800), length 170: 192.168.253.9.2049 > 192.168.253.12.4: reply ok 128 lookup fh Unknown/0100010101000000B20800000000000000000000000000000000000000000000* U" L$ G5 H* E
09:46:34.949835 b4:99:4c:b8:6f:69 > 02:40:43:77:07:01, ethertype IPv4 (0x0800), length 146: 192.168.253.12.5 > 192.168.253.9.2049: 104 read fh Unknown/0100010101000000B20800000000000000000000000000000000000000000000 1024 bytes @ 0: ^' o- {1 D( J) j! \2 F# l
0 {3 n$ [* t" v$ ?, h5 Z; E6 r
server端dhcp配置文件:. ^! k S! |% q& F" N+ ~- p
/etc/dhcp/dhcpd.conf:: |' }6 A) C( e7 X$ ^+ B" z" R* L
one-lease-per-client on; # 每一个客户机对应一个租约信息; r3 v! M4 |. _0 b( R
subnet 192.168.253.8 netmask 255.255.255.248 {
& C+ a# p4 x$ U, D3 C: U range dynamic-bootp 192.168.253.10 192.168.253.14;3 |, H9 B5 k: i* Y& n5 r6 e' H
next-server 192.168.253.9;#设定存放初始启动文档的主机地址,The next-server statement is used to specify the host address of the server from which the initial boot file (specified in the filename statement) is to be loaded. Server-name should be a numeric IP address or a domain name. If no next-server statement applies to a given client, the address 0.0.0.0 is used.
( i3 X& r C$ E/ L- w+ }" | option subnet-mask 255.255.255.248;) O* X1 }- v1 P S- H- L3 r* z$ \1 t
filename "u-boot-eth.bin"; ##下载启动文档的文件名,这个filename语句可以用来指定客户端启动要载入的初始启动文件,这个文件名应该是客户端能够识别的任何文件传送协议,可以用来传送那个文件。
, y: l$ ~+ s, }" i6 t$ ^ option root-path "/squash/ks";
& @9 K" J/ n* {2 S4 L" _% p0 A default-lease-time -1; #无限租约时间' q, S. O0 \; I$ W+ G5 w+ ^
max-lease-time -1; #无限租约时间
* U+ E; }. J7 u4 R; D# ?3 p) }- m }
/ {7 V0 S- H8 j& y6 S4 F
8 u- M5 D" S7 c) ?/ MThe next-server directive is used to specify the IP address of the TFTP server.
0 [ `$ ?& ~5 _" Z" sThe filename directive defines the path to /boot/pxeboot. A relative filename is used, meaning that /b/tftpboot is not included in the path.
! K1 N3 M9 n0 i8 J1 |) G( rThe root-path option defines the path to the NFS root file system.
2 m2 L" N6 W, p9 E& ^$ X2 v
2 F3 k; \# k; F5 y |
|