Difference between revisions of "OpenWRT IPv6: Konfigurasi OLSR 6and4"

From OnnoWiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
Kita dapat mengedit file
 
Kita dapat mengedit file
  
/etc/config/olsrd
+
==/etc/config/olsrd==
  
 
Misalnya, sebagai berikut
 
Misalnya, sebagai berikut
  
 
  config olsrd
 
  config olsrd
        # uncomment the following line to use a custom config file instead:
+
        # uncomment the following line to use a custom config file instead:
        #option config_file '/etc/olsrd.conf'
+
        #option config_file '/etc/olsrd.conf'
 +
        option IpVersion '6and4'
 +
        # option IpVersion '4'
 +
        option FIBMetric 'flat'
 +
        option LinkQualityLevel '2'
 +
        option LinkQualityAlgorithm 'etx_ff'
 +
        option OlsrPort '698'
 +
        option Willingness '3'
 +
        option NatThreshold '1.0'
 +
 +
config LoadPlugin
 +
        option library 'olsrd_arprefresh.so.0.1'
 
   
 
   
        option IpVersion '6and4'
+
config LoadPlugin
 +
        option library 'olsrd_dyn_gw.so.0.5'
 +
 +
config LoadPlugin
 +
        option library 'olsrd_txtinfo.so.0.1'
 +
        option accept '0.0.0.0'
 
   
 
   
 
  config Interface
 
  config Interface
        list interface 'ninuxif'
+
        option ignore '0'
 +
        option interface 'MESH'
 +
        option Mode 'mesh'
 
   
 
   
  config 'Hna4'
+
  config InterfaceDefaults
        option 'netaddr' '192.168.1.0'
+
        option Mode 'mesh'
        option 'netmask' '255.255.255.0'
 
 
   
 
   
  config 'Hna6'
+
  config Hna6
        option 'netaddr' '2002::'
+
        option netaddr '2001:123:124::'
        option 'prefix' '64'
+
        option prefix '64'
 +
 +
config Hna6
 +
        option netaddr '2001:123:124::2'
 +
        option prefix '128'
 +
 +
config Hna4
 +
        option netaddr '10.123.124.2'
 +
        option prefix '32'
  
  
Line 62: Line 87:
 
  option ip6addr '2001:222:222::2'
 
  option ip6addr '2001:222:222::2'
  
==/etc/config/wirelesss==
+
==/etc/config/network==
 +
 
 +
config interface 'loopback'
 +
        option ifname 'lo'
 +
        option proto 'static'
 +
        option ipaddr '127.0.0.1'
 +
        option netmask '255.0.0.0'
 +
 +
config interface 'lan'
 +
        option ifname 'eth0'
 +
        option type 'bridge'
 +
        option proto 'static'
 +
        option ipaddr '192.168.1.1'
 +
        option netmask '255.255.255.0'
 +
        option ip6addr '2001:123:124::3'
 +
        option ip6assign '64'
 +
        option ip6hint '2001:123:124::'
 +
 +
config interface 'wan6'
 +
        option ifname '@wan'
 +
        option proto 'dhcpv6'
 +
 +
config globals 'globals'
 +
        option ula_prefix '2001:123:124::/64'
 +
 +
config interface 'MESH'
 +
        option _orig_ifname 'wlan0'
 +
        option _orig_bridge 'false'
 +
        option proto 'static'
 +
        option ipaddr '10.123.124.2'
 +
        option netmask '255.0.0.0'
 +
        option ip6addr '2001:123:124::2/128'
 +
 
  
 +
==/etc/config/wireless==
  
 
  config wifi-device  radio0
 
  config wifi-device  radio0
option type    mac80211
+
        option type    mac80211
option channel  1
+
        option channel  1
option hwmode 11g
+
        option hwmode   11g
option path 'platform/ar231x-wmac.0'
+
        option path     'platform/ar231x-wmac.0'
option txpower  '20'
+
        option txpower  '20'
option htmode 'HT20'
+
        option htmode   'HT20'
# REMOVE THIS LINE TO ENABLE WIFI:
+
        # REMOVE THIS LINE TO ENABLE WIFI:
option disabled 0
+
        option disabled 0
 
   
 
   
 
  config wifi-iface
 
  config wifi-iface
option device 'radio0'
+
        option device 'radio0'
option encryption 'none'
+
        option encryption 'none'
option mode 'adhoc'
+
        option mode 'adhoc'
option bssid '02:CA:FF:EE:BA:BE'
+
        option bssid '02:CA:FF:EE:BA:BE'
option network 'MESH'
+
        option network 'MESH'
option ssid 'MESH'
+
        option ssid 'MESH'
 +
 
 +
==/etc/config/ahcpd==
  
 +
package ahcpd
 +
config ahcpd
 +
        option 'mode' 'server'
 +
        list 'interface' 'br-lan'
 +
        list 'prefix' '2001:123:124::/64'
  
==/etc/config/olsrd==
 
  
config olsrd
+
==/etc/rc.local==
# uncomment the following line to use a custom config file instead:
 
#option config_file '/etc/olsrd.conf'
 
# option IpVersion '6and4'
 
option IpVersion '4'
 
option FIBMetric 'flat'
 
option LinkQualityLevel '2'
 
option LinkQualityAlgorithm 'etx_ff'
 
option OlsrPort '698'
 
option Willingness '3'
 
option NatThreshold '1.0'
 
 
config LoadPlugin
 
option library 'olsrd_arprefresh.so.0.1'
 
 
config LoadPlugin
 
option library 'olsrd_dyn_gw.so.0.5'
 
 
config LoadPlugin
 
option library 'olsrd_httpinfo.so.0.1'
 
option port '1978'
 
list Net '0.0.0.0 0.0.0.0'
 
 
config LoadPlugin
 
option library 'olsrd_nameservice.so.0.3'
 
option ignore '0'
 
option latlon_file '/var/run/latlon.js'
 
option hosts_file '/etc/hosts'
 
option resolv_file '/etc/resolv.conf'
 
 
config LoadPlugin
 
option library 'olsrd_txtinfo.so.0.1'
 
option accept '0.0.0.0'
 
 
config Interface
 
option ignore '0'
 
option interface 'MESH'
 
option Mode 'mesh'
 
 
config InterfaceDefaults
 
option Mode 'mesh'
 
 
config Hna6
 
option netaddr '2001:222:222:2::'
 
option prefix '64'
 
  
 +
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
 +
/etc/init.d/olsrd stop
 +
sleep 10
 +
killall olsrd
 +
killall olsrd
 +
/usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv6 -nofork &
 +
/usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv4 -nofork &
  
 
==Referensi==
 
==Referensi==

Latest revision as of 08:19, 21 October 2014

Sumber: https://dev.openwrt.org/ticket/4803


Agar OLSR dapat beroperasi sekaligus untuk IPv4 & IPv6 kita harus menggunakan IpVersion '6and4'. Kita dapat mengedit file

/etc/config/olsrd

Misalnya, sebagai berikut

config olsrd
        # uncomment the following line to use a custom config file instead:
        #option config_file '/etc/olsrd.conf'
        option IpVersion '6and4'
        # option IpVersion '4'
        option FIBMetric 'flat'
        option LinkQualityLevel '2'
        option LinkQualityAlgorithm 'etx_ff'
        option OlsrPort '698'
        option Willingness '3'
        option NatThreshold '1.0'

config LoadPlugin
        option library 'olsrd_arprefresh.so.0.1'

config LoadPlugin
        option library 'olsrd_dyn_gw.so.0.5'

config LoadPlugin
        option library 'olsrd_txtinfo.so.0.1'
        option accept '0.0.0.0'

config Interface
        option ignore '0'
        option interface 'MESH'
        option Mode 'mesh'

config InterfaceDefaults
        option Mode 'mesh'

config Hna6
        option netaddr '2001:123:124::'
        option prefix '64'

config Hna6
        option netaddr '2001:123:124::2'
        option prefix '128'

config Hna4
        option netaddr '10.123.124.2'
        option prefix '32'


cocokan dengan kondisi jaringan anda :)

/etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config interface 'lan'
	option ifname 'eth0'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ip6prefix '2001:222:222:2::/64'
	option ip6addr '2001:222:222:2::1'

config interface 'wan6'
	option ifname '@wan'
	option proto 'dhcpv6'

config globals 'globals'
	option ula_prefix '2001:222:222:2::/64'

config interface 'MESH'
	option proto 'static'
	option ipaddr '10.123.123.2'
	option netmask '255.0.0.0'
	option ip6gw '2001:123:123::2'
	option ip6prefix '2001:123:123::/64'
	option ip6addr '2001:222:222::2'

/etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6addr '2001:123:124::3'
        option ip6assign '64'
        option ip6hint '2001:123:124::'

config interface 'wan6'
        option ifname '@wan'
        option proto 'dhcpv6'

config globals 'globals'
        option ula_prefix '2001:123:124::/64'

config interface 'MESH'
        option _orig_ifname 'wlan0'
        option _orig_bridge 'false'
        option proto 'static'
        option ipaddr '10.123.124.2'
        option netmask '255.0.0.0'
        option ip6addr '2001:123:124::2/128'


/etc/config/wireless

config wifi-device  radio0
        option type     mac80211
        option channel  1
        option hwmode   11g
        option path     'platform/ar231x-wmac.0'
        option txpower  '20'
        option htmode   'HT20'
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

config wifi-iface
        option device 'radio0'
        option encryption 'none'
        option mode 'adhoc'
        option bssid '02:CA:FF:EE:BA:BE'
        option network 'MESH'
        option ssid 'MESH'

/etc/config/ahcpd

package ahcpd
config ahcpd
        option 'mode' 'server'
        list 'interface' 'br-lan'
        list 'prefix' '2001:123:124::/64'


/etc/rc.local

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
/etc/init.d/olsrd stop
sleep 10
killall olsrd
killall olsrd
/usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv6 -nofork &
/usr/sbin/olsrd -f /var/etc/olsrd.conf.ipv4 -nofork &

Referensi


Pranala Menarik

Build Firmware

APRX

IPv6

Flash Firmware

Misc

UBNT