rehat linux设置ip,RedhatHat配置IPv6地址

RedhatHat配置IPv6地址:

修改网卡配置文件:

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth4

DEVICE="eth4"

BOOTPROTO="none"

HWADDR="00:50:56:AA:69:EF"

#NM_CONTROLLED="yes"

ONBOOT="yes"

TYPE="Ethernet"

#UUID="4e44fcc7-a050-4271-a07f-2d32d319be74"

#IPADDR=192.168.73.58

#NETMASK=255.255.255.0

#GATEWAY=192.168.73.1

IPV6INIT=yes

USERCTL=yes

IPV6ADDR=2001::5656

IPV6PREFIX=64

#IPV6_AUTOCONF=no

配置网关:

[root@localhost ~]# cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=localhost.localdomain

NETWORKING_IPV6=yes

IPV6_DEFAULTGW=2001::1212%eth4

手动配置IP:

ifconfig eth0 inet6 add 2001::5656/64

手动添加默认路由:

[root@localhost ~]# ip -6 addr add 2001::1212/64 dev eth4

查看路由:

[root@localhost ~]# route -A inet6

Kernel IPv6 routing table

Destination                                 Next Hop                                Flags Metric Ref    Use Iface

getnameinfo failed

getnameinfo failed

[UNKNOWN]/128                               [UNKNOWN]                               UC    0      1        1 eth4

getnameinfo failed

[UNKNOWN]/64                                *                                       U     256    12       0 eth4

getnameinfo failed

[UNKNOWN]/64                                *                                       U     256    0        0 eth4

getnameinfo failed

*/0                                         [UNKNOWN]                               UGDA  1024   26       0 eth4

localhost/128                               *                                       U     0      0        1 lo

getnameinfo failed

[UNKNOWN]/128                               *                                       U     0      620       1 lo

getnameinfo failed

[UNKNOWN]/128                               *                                       U     0      24       1 lo

getnameinfo failed

[UNKNOWN]/128                               *                                       U     0      20       1 lo

getnameinfo failed

[UNKNOWN]/8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值