src addr в DHCP-ответе

IPoE related questions
mr.Scamp
Posts: 10
Joined: 29 Nov 2014, 20:50

src addr в DHCP-ответе

Post by mr.Scamp »

Заметил, что аксель отвечает на DHCP-запросы с совершенно другого адреса, нежели его адрес в сегменте.
accel-ppp version b276238f8721849c364cf718f854c7b07a706254

Code: Select all

22:47:36.588029 00:1b:21:b3:2b:c9 > d8:50:e6:47:b0:45, ethertype 802.1Q (0x8100), length 324: vlan 1131, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 20451, offset 0, flags [DF], proto UDP (17), length 306)
    193.106.144.2.67 > 10.11.31.6.68: BOOTP/DHCP, Reply, length 278, xid 0x3aec8852, Flags [none]
	  Client-IP 10.11.31.6
	  Your-IP 10.11.31.6
	  Client-Ethernet-Address d8:50:e6:47:b0:45
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message Option 53, length 1: ACK
	    Server-ID Option 54, length 4: 10.11.31.1
	    Lease-Time Option 51, length 4: 300
	    Default-Gateway Option 3, length 4: 10.11.31.1
	    Subnet-Mask Option 1, length 4: 255.255.255.224
	    Domain-Name-Server Option 6, length 8: 193.106.144.6,193.106.144.7
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: src addr в DHCP-ответе

Post by Dmitry »

что в конфиге и что выдаёт радиус ?
mr.Scamp
Posts: 10
Joined: 29 Nov 2014, 20:50

Re: src addr в DHCP-ответе

Post by mr.Scamp »

Code: Select all

[ipoe]
verbose=3
username=lua:username
lease-time=300
max-lease-time=360
unit-cache=256
l4-redirect-ipset=guest-ipoe
shared=1
ifcfg=0
mode=L2
start=dhcpv4
proxy-arp=1
proto=100
attr-dhcp-client-ip=Framed-IP-Address
attr-dhcp-router-ip=DHCP-Router-IP-Address
attr-dhcp-mask=DHCP-Mask
attr-dhcp-lease-time=DHCP-Lease-Time
attr-l4-redirect=L4-Redirect
lua-file=/etc/accel-ppp.lua
interface=re:^vlan11[13579]\d$
interface=re:^vlan12[13579]\d$
interface=re:^vlan13[13579]\d$
interface=re:^vlan14[13579]\d$
все адреса назначаются радиусом,
вот пример запроса-ответа

Code: Select all

[2014-11-30 13:58:15]:  info: ipoe267: send [RADIUS(2) Access-Request id=1 <User-Name "20:1a:06:81:4d:e0"> <NAS-Identifier "bras1"> <NAS-IP-Address 172.16.0.1> <NAS-Port 758> <NAS-Port-Id "ipoe267"> <NAS-Port-Type Ethernet> <Calling-Station-Id "20:1a:06:81:4d:e0"> <Called-Station-Id "vlan1173"> <User-Password >]
[2014-11-30 13:58:15]:  info: ipoe267: recv [RADIUS(2) Access-Accept id=1 <Acct-Interim-Interval 300> <Filter-Id "102400/102400"> <DHCP-Mask 27> <DHCP-Router-IP-Address 10.11.73.1> <Framed-IP-Address 10.11.73.5>]
[2014-11-30 13:58:15]:  info: ipoe267: 20:1a:06:81:4d:e0: authentication succeeded
193.106.144.2 - это адрес на интерфейсе, куда направлен default route.
User avatar
Абрамчук Вадим
Posts: 75
Joined: 21 Oct 2014, 20:15

Re: src addr в DHCP-ответе

Post by Абрамчук Вадим »

NAT в iptables поправьте, допишите -o ethX.
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: src addr в DHCP-ответе

Post by Dmitry »

пробовал у себя воспроизвести - не получается, отвечает своим адресом (Server-ID)
mr.Scamp
Posts: 10
Joined: 29 Nov 2014, 20:50

Re: src addr в DHCP-ответе

Post by mr.Scamp »

Хм, NAT у меня маскарадит в другие адреса, 193.106.144.2 в них не числится.
Переделал правила, ничего не изменилось.
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: src addr в DHCP-ответе

Post by Dmitry »

проверь: ip route get 10.11.73.5
mr.Scamp
Posts: 10
Joined: 29 Nov 2014, 20:50

Re: src addr в DHCP-ответе

Post by mr.Scamp »

Code: Select all

listening on vlan1112, link-type EN10MB (Ethernet), capture size 65535 bytes
15:06:50.620983 e8:94:f6:3b:4f:7b > 00:1b:21:b3:2b:c9, ethertype IPv4 (0x0800), length 351: 10.11.12.11.68 > 10.11.12.1.67: BOOTP/DHCP, Request from e8:94:f6:3b:4f:7b, length 309
15:06:50.621491 00:1b:21:b3:2b:c9 > e8:94:f6:3b:4f:7b, ethertype IPv4 (0x0800), length 320: 193.106.144.2.67 > 10.11.12.11.68: BOOTP/DHCP, Reply, length 278

Code: Select all

sasha@bras1:~$ ip route get 10.11.12.11
10.11.12.11 dev ipoe41  src 10.11.12.1 
    cache 
mr.Scamp
Posts: 10
Joined: 29 Nov 2014, 20:50

Re: src addr в DHCP-ответе

Post by mr.Scamp »

Заметил, что броадкаст идет с правильного адреса,

Code: Select all

10:42:36.439138 40:61:86:89:35:88 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 350: vlan 1112, p 0, ethertype IPv4, 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 40:61:86:89:35:88, length 304
10:42:36.513242 00:1b:21:b3:2b:c9 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 324: vlan 1112, p 0, ethertype IPv4, 10.11.12.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 278
10:42:36.537268 40:61:86:89:35:88 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 374: vlan 1112, p 0, ethertype IPv4, 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 40:61:86:89:35:88, length 328
10:42:36.537685 00:1b:21:b3:2b:c9 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 324: vlan 1112, p 0, ethertype IPv4, 10.11.12.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 278
Dmitry
Администратор
Posts: 954
Joined: 09 Oct 2014, 10:06

Re: src addr в DHCP-ответе

Post by Dmitry »

потому-что броадкаст отправляется через raw сокет, что исключает его маршрутизацию
Post Reply