ipv6 dhcp network relay 配置說明


配置>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
config dhcp 'lan' option interface 'lan' # 綁定接口 option start '100' # 不再使用 option limit '150' option force '1' option leasetime '720m' # option ignore '0' # Specifies whether dnsmasq should ignore this pool if set to 1 option ra_management '1' # DHCPv6模式 RA management mode : no M-Flag but A-Flag (0), both M and A flags (1), M flag but not A flag (2) option ra_mininterval '10' # 最小RA間隔 Minimum time interval between RAs (in seconds) option ra_maxinterval '15' # 最大RA間隔 Maximum time interval between RAs (in seconds) option ra 'relay' # 路由通告 Specifies whether Router Advertisements should be enabled (server), relayed (relay) or disabled (disabled option dhcpv6 'server' # DHCPv6服務 Specifies whether DHCPv6 server should be enabled (server), relayed (relay) or disabled (disabled option ndp 'relay' # NDP代理 Specifies whether NDP should be relayed (relay) or disabled (disabled list dhcp_option '43,192.168.1.3' # 43 表示供應商指定信息
    
list dhcp_option '3,192.168.1.3' # 3 默認路由
   list dhcp_option '6,192.168.1.3' # 6 默認dns
list range '192.168.1.20 192.168.1.30' # dhcp地址范圍, 用空格分開

openwrt 官方文檔: --> https://openwrt.org/docs/guide-user/base-system/dhcp 

保存>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
save_dhcp_server
/etc/init.d/network reload >/dev/null 2>/dev/null;
/etc/init.d/dnsmasq restart
/etc/init.d/dhcpd stop;sleep 1;/etc/init.d/dhcpd start;/etc/init.d/odhcpd restart

 

dhcrelay配置>>>>>>>>>>>>>>>>>>>>>>>>>>>>


config dhcrelay 'ipv4'
   option dhcpserver '10.10.10.254'               # v4目標服務器
  option enabled '1'                             # 在接口上啟用DHCPv4中繼 
  option relay_mode 'forward'                    # 代理選項 What to do about packets that already have a relay option
  option upstream_interfaces 'lan'               # 監聽上行口
  option downstream_interfaces 'yy'              # 監聽下行口

config dhcrelay 'ipv6'
  option dhcpserver '2001:db8:1::1'              #v6 目標服務器 
  option enabled '1'                             # 啟用開關
  option upper 'wan'                             # 監聽上行口
  list lower 'yy'                                # 監聽下行口


/etc/init.d/dhcrelay4 restart ;/etc/init.d/dhcrelay6 restart

 靜態路由

config route6 'ww'
        option name 'ww'                       # 配置名稱             
        option metric '12'                    # metric
        option mtu '1500'                     # MTU 
        option target '1.1.1.1'               # 目的地址
        option gateway '2.2.2.2'              # IPv6 網關
        option type 'broadcast'               # 路由類型 
        option table 'main'                   # 路由表
        option onlink '1'                     # 路由在線
        option interface 'lan'                # 接口

os.execute("/etc/init.d/network reload;")

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM