linux添加ipv6静态路由命令,Debian下配置IPV6和静态路由

一、编辑网卡文件

vi /etc/network/interfaces

二、修改网卡文件# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

# iface eth0 inet6 dhcp

iface eth0 inet6 static

address 2001:da8:203:ec8:a00:27ff:fe6b:7ed

netmask 64

gateway 2001:da8::1

iface eth0 inet static

address 192.168.1.193

netmask 255.255.255.0

gateway 192.168.1.1

三、添加IPV6路由route -A inet6 add default gw 2001:da8:203:ec8::1 dev eth0

#接口启用时添加一条路由

# up route -A inet6 add default gw 2001:da8:203:ec8::1 dev eth0

#接口不可用时删除一条路由

#down route -A inet6 add default gw 2001:da8:203:ec8::1 dev eth0

#添加静态路由包含下一跳

#格式为 route -A

你可能感兴趣的:(linux添加ipv6静态路由命令,Debian下配置IPV6和静态路由)