rendered paste bodyINIT GATE
#!/usr/local/bin/bash
#IPv6: 2001:618:400:52e7::/64
#tunnel
tif="gif0"
#interphase physique
lif="rl1"
# addr ipv4 locale
myip=82.231.146.43
# addr ipv4 du TB
gate=213.121.24.85
# addr ipv6 locale
myipv6=2001:618:400:971e::1
v6gate=2001:618:400::52e7:922b
start(){
ifconfig $tif create
#create ipv4 tunnel
ifconfig $tif giftunnel $myip $gate
#then ipv6 one
ifconfig $tif inet6 $myipv6 prefixlen 128
#routing rules
# route add -inet6 default fe80::%$tif
#" ifconfig $tif inet6 $myipv6 $v6gate prefixlen 128
# route add -inet6 $v6gate -prefixlen 64 $myipv6
# route add -inet6 default $v6gate
}
TABLE ROUTAGE GATE
Internet6:
Destination Gateway Flags Refs Use Mtu Interface
::/104 ::1 UGRS 0 0 - lo0 =>
::/96 ::1 UGRS 0 0 - lo0 =>
default 2001:618:400:971e::1 UGS 1 159 - gif0
::1 ::1 UH 12 0 33224 lo0
::127.0.0.0/104 ::1 UGRS 0 0 - lo0
::224.0.0.0/100 ::1 UGRS 0 0 - lo0
::255.0.0.0/104 ::1 UGRS 0 0 - lo0
::ffff:0.0.0.0/96 ::1 UGRS 0 0 - lo0
2001:618:400:971e::1 link#11 UHL 2 0 - lo0
2002::/24 ::1 UGRS 0 0 - lo0
2002:7f00::/24 ::1 UGRS 0 0 - lo0
2002:e000::/20 ::1 UGRS 0 0 - lo0
2002:ff00::/24 ::1 UGRS 0 0 - lo0
fe80::/10 ::1 UGRS 4 51 - lo0
fe80::%rl0/64 link#1 UC 0 0 - rl0
fe80::208:54ff:fe16:cdcd%rl0 0:8:54:16:cd:cd UHL 0 0 - lo0
fe80::%rl1/64 link#2 UC 1 0 - rl1
fe80::203:25ff:fe05:1ab2%rl1 0:3:25:5:1a:b2 UHLc 0 0 - rl1
fe80::250:fcff:fe9e:fe4e%rl1 0:50:fc:9e:fe:4e UHL 0 0 - lo0
fe80::%lo0/64 fe80::1%lo0 U 0 0 - lo0
fe80::1%lo0 link#6 UHL 0 0 - lo0
fe80::%gif0/64 link#11 UC 0 0 - gif0
fe80::208:54ff:fe16:cdcd%gif0 link#11 UHL 0 0 - lo0
fec0::/10 ::1 UGRS 0 0 - lo0
ff01::/32 ::1 UC 0 0 - lo0
ff02::%rl0/32 link#1 UC 0 0 - rl0
ff02::%rl1/32 link#2 UC 0 0 - rl1
ff02::%lo0/32 ::1 UC 0 0 - lo0
ff02::%gif0/32 link#11 UC 0 0 - gif0
IFCONFIG
-bash-3.00# ifconfig rl1
rl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:50:fc:9e:fe:4e
media: Ethernet autoselect (100baseTX)
status: active
inet 192.168.0.5 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::250:fcff:fe9e:fe4e%rl1 prefixlen 64 scopeid 0x2
-bash-3.00# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33224
groups: lo
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:08:54:16:cd:cd
groups: egress
media: Ethernet autoselect (10baseT full-duplex)
status: active
inet6 fe80::208:54ff:fe16:cdcd%rl0 prefixlen 64 scopeid 0x1
inet 82.231.146.43 netmask 0xffffff00 broadcast 82.231.146.255
rl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:50:fc:9e:fe:4e
media: Ethernet autoselect (100baseTX)
status: active
inet 192.168.0.5 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::250:fcff:fe9e:fe4e%rl1 prefixlen 64 scopeid 0x2
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33224
pfsync0: flags=0<> mtu 1348
enc0: flags=0<> mtu 1536
gif0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
groups: gif
physical address inet 82.231.146.43 --> 213.121.24.85
inet6 fe80::208:54ff:fe16:cdcd%gif0 -> prefixlen 64 scopeid 0xb
inet6 2001:618:400:971e::1 -> prefixlen 128
-bash-3.00#
CLIENT
eth1 Lien encap:Ethernet HWaddr 00:03:25:05:1A:B2
inet adr:192.168.0.6 Bcast:192.168.0.255 Masque:255.255.255.0
adr inet6: 2001:618:400:971e:203:25ff:fe05:1ab2/64 Scope:Global
adr inet6: fe80::203:25ff:fe05:1ab2/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:898493 errors:394 dropped:1875 overruns:279 frame:0
TX packets:364229 errors:0 dropped:0 overruns:0 carrier:0
collisions:170679 lg file transmission:1000
RX bytes:1104475030 (1053.3 Mb) TX bytes:159770845 (152.3 Mb)
Interruption:10 Adresse de base:0x8c00
TABLE ROUTAGE CLIENT
birdy ~ # r
Table de routage IPv6 du noyau
Destination Prochain Hop Indic Metric Ref Utilis. Iface
::1/128 :: U 0 17 1 lo
2001:618:400:971e:203:25ff:fe05:1ab2/128 :: U 0 240 1 lo
2001:618:400:971e::/64 :: UA 256 3 0 eth1
fe80::203:25ff:fe05:1ab2/128 :: U 0 0 1 lo
fe80::/64 :: U 256 0 0 eth1
ff02::1/128 ff02::1 UC 0 1 0 eth1
ff00::/8 :: U 256 0 0 eth1
::/0 fe80::250:fcff:fe9e:fe4e UGDA 1024 1 0 eth1
birdy ~ #