Skip to content

Instantly share code, notes, and snippets.

@tom-code
Created December 22, 2019 23:01
Show Gist options
  • Save tom-code/b3814e90cf6512fe0bdc7a65f127091b to your computer and use it in GitHub Desktop.
Save tom-code/b3814e90cf6512fe0bdc7a65f127091b to your computer and use it in GitHub Desktop.
openwrt ipv6 fun in vm
qemu-system-arm -M virt-2.9 -kernel openwrt-18.06.5-armvirt-32-zImage -no-reboot -nographic \
-device virtio-net-pci,mac=00:00:00:00:00:01,netdev=br0 -netdev bridge,br=br0,id=br0 \
-device virtio-net-pci,mac=00:00:00:00:00:02,netdev=br1 -netdev bridge,br=br1,id=br1 \
-m 128M \
-drive file=openwrt-18.06.5-armvirt-32-root.ext4,if=virtio,format=raw \
-append "root=/dev/vda"
network:
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd24:d9b3:d91e::/48'
config interface 'wan'
option ifname 'eth0'
option proto dhcp
config interface 'wan6'
option ifname 'eth0'
option proto dhcpv6
config interface 'lan'
# option type 'bridge'
option ifname 'eth1'
option proto 'static'
option ipaddr '192.168.10.1'
option netmask '255.255.255.0'
option ip6assign '64'
dhcp:
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option logdhcp '1'
option logfacility '/tmp/dnsmasq.log'
config dhcp 'lan'
option interface 'lan'
option start '130'
option limit '20'
option leasetime '12h'
option dhcpv6 'server'
option ra 'server'
option dhcpv4 'server'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config dhcp 'wan6'
option interface 'wan6'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
firewall:
config zone
option name test
#list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq 1
option mtu_fix 1
option subnet 2001:af0:ffe4:980a::/64
config forwarding
option src wan
option dest test
option family ipv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment