# Lab 7. System and Network administartion
## Timur Mustafin
# IPv6 setup
I signed up on ipv6.ip4market.ru and got my IPv6 range.
## Scaleway story
I've tried to set up everything on scaleway machine with VPN on it but i didn't manage to fix this two problems:
1. `add tunnel "sit0" failed: No buffer space available`
1. `RTNETLINK answers: File exists`
config was
```
auto he-ipv6
iface he-ipv6 inet6 v4tunnel
address 2a03:e2c0:1004::2
netmask 64
endpoint 193.0.203.203
local 51.15.93.11
ttl 255
gateway 2a03:e2c0:1004::1
```
I also tried to use private Scaleway IP (because google suggested but it makes no sense)
So, after rebooting, ifup'ing and ifdown'ing I switched to another idea
## DD-WRT router
I have an old router in my room with DD-WRT installed. So, i did everything there.
### Firmware
Installed to this custom version in order to have ipv6

### Setting up
enable `Radvd` and put configuration for it:

interface br0
{
AdvSendAdvert on;
prefix 2a03:e2c0:1004:5555::/64
{
AdvOnLink on;
AdvAutonomous on;
};
};
Start up script
ip tunnel add he-ipv6 mode sit remote 193.0.203.203 ttl 64
ip link set he-ipv6 up
ip addr add 2a03:e2c0:1004::2 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip addr add 2a03:e2c0:1004:5555::/64 dev br0
IPTables:
insmod ip6t_REJECT
ip6tables -F
ip6tables -A FORWARD -p tcp -i he-ipv6 -syn -m multiport &#-106;dports ftp-data,ftp,ssh,smtp,http,https,ntp,domain -j ACCEPT
ip6tables -A FORWARD -p tcp -i he-ipv6 -syn -j REJECT -reject-with adm-prohibited
ip6tables -A FORWARD -p udp -i he-ipv6 -m multiport -dports ntp,domain -j ACCEPT
ip6tables -A FORWARD -p udp -i he-ipv6 -j REJECT -reject-with adm-prohibited
### Testing
Mac didn't recieve IPv6 for some reason

But Android did:


### Cron
Also we need to renew the ip every month (but i will run it everyday just for simplicity)
