Jump to content
Калькуляторы

linux + ip unnumbered + dhcp

Выглядит примерно так:

eth0.2  Link encap:Ethernet  HWaddr 00:21:91:8a:ce:46  
         inet addr:10.2.2.1  Bcast:10.2.2.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:16609 errors:0 dropped:0 overruns:0 frame:0
         TX packets:35309 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:850294 (830.3 KiB)  TX bytes:51641642 (49.2 MiB)

eth0.2:1 Link encap:Ethernet  HWaddr 00:21:91:8a:ce:46  
         inet addr:8.8.8.1  Bcast:8.8.8.1  Mask:255.255.255.255
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric

eth0.3  Link encap:Ethernet  HWaddr 00:21:91:8a:ce:46  
         inet addr:10.2.3.1  Bcast:10.2.3.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:16609 errors:0 dropped:0 overruns:0 frame:0
         TX packets:35309 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:850294 (830.3 KiB)  TX bytes:51641642 (49.2 MiB)

eth0.3:1 Link encap:Ethernet  HWaddr 00:21:91:8a:ce:46  
         inet addr:8.8.8.1  Bcast:8.8.8.1  Mask:255.255.255.255
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric

 

dhpc пытался сконфигурить так, но тщетно:

shared-network vlan2 {
subnet 10.2.2.0 netmask 255.255.255.0 {
       option routers          10.2.2.1;
       option subnet-mask      255.255.255.0;
       }
subnet 8.8.8.0 netmask 255.255.255.0 {
       option routers          8.8.8.1;
       option subnet-mask      255.255.255.0;
       }
}
shared-network vlan3 {
subnet 10.2.3.0 netmask 255.255.255.0 {
       option routers          10.2.3.1;
       option subnet-mask      255.255.255.0;
       }
subnet 8.8.8.0 netmask 255.255.255.0 {
       option routers          8.8.8.1;
       option subnet-mask      255.255.255.0;
       }
}

 

как такое обычно делается?

Edited by kaktak

Share this post


Link to post
Share on other sites

Именно так и делается, и даже работает. Не хватает ключевого слова range, либо привязки хостов по MAC.

Share this post


Link to post
Share on other sites

Привязки конечно есть, но дело не в этом, демон не стартует с такой конфигурацией.

А вот так стартовал:

shared-network test {
subnet 10.2.2.0 netmask 255.255.255.0 {
       option routers          10.2.2.1;
       option subnet-mask      255.255.255.0;
       }
subnet 10.2.3.0 netmask 255.255.255.0 {
       option routers          10.2.3.1;
       option subnet-mask      255.255.255.0;
       }
subnet 8.8.8.0 netmask 255.255.255.0 {
       option routers          8.8.8.1;
       option subnet-mask      255.255.255.0;
       }
}

 

буду смотреть, как это теперь работает

Share this post


Link to post
Share on other sites

Вроде все работает, но например при такой конфигурации:

shared-network test {
subnet 10.2.2.0 netmask 255.255.255.0 {
       option routers          10.2.2.1;
       option subnet-mask      255.255.255.0;
       }
subnet 10.2.3.0 netmask 255.255.255.0 {
       option routers          10.2.3.1;
       option subnet-mask      255.255.255.0;
       }
subnet 8.8.8.0 netmask 255.255.255.0 {
       option routers          8.8.8.1;
       option subnet-mask      255.255.255.0;
       }
}

group { 
       host 1 {
                       hardware ethernet 40:40:40:5A:5A:5A;
                       fixed-address 10.2.2.2;
               }
}

 

абонент с маком 40:40:40:5A:5A:5A получит ip 10.2.2.2 и из 2-ого влана и из 3-его...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.