标签:inet6 conda pretty oba ip地址 multicast www docker 参数配置
root@node1:~# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
root@node1:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:66:44:d2 brd ff:ff:ff:ff:ff:ff inet 192.168.0.106/24 brd 192.168.0.255 scope global dynamic noprefixroute ens33 valid_lft 6873sec preferred_lft 6873sec inet6 fe80::20c:29ff:fe66:44d2/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:66:44:dc brd ff:ff:ff:ff:ff:ff inet 10.1.1.13/24 brd 10.1.1.255 scope global ens34 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe66:44dc/64 scope link valid_lft forever preferred_lft forever 4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:55:7f:00:71 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever
可以看出,此时有两个物理网卡,分别是ens33和ens34
root@node1:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback
auto ${网卡名} iface ${网卡名} inet ${static} address ${IP} netmask ${netmask} gateway ${gateway}
auto ens33 iface ens33 inet dhcp
auto ens34 iface ens34 inet static address 10.1.1.13 netmask 255.255.255.0 gateway 10.1.1.2
root@node1:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback auto ens33 iface ens33 inet dhcp auto ens34 iface ens34 inet static address 10.1.1.13 netmask 255.255.255.0 gateway 10.1.1.2
重启网络服务即可
systemctl restart networking
root@node1:~# systemctl restart networking root@node1:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:66:44:d2 brd ff:ff:ff:ff:ff:ff inet 192.168.0.106/24 brd 192.168.0.255 scope global dynamic noprefixroute ens33 valid_lft 5005sec preferred_lft 5005sec inet 192.168.0.200/24 brd 192.168.0.255 scope global secondary ens33 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe66:44d2/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:66:44:dc brd ff:ff:ff:ff:ff:ff inet 10.1.1.13/24 brd 10.1.1.255 scope global ens34 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe66:44dc/64 scope link tentative valid_lft forever preferred_lft forever 4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:55:7f:00:71 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever root@node1:~# vim /etc/network/interfaces
标签:inet6 conda pretty oba ip地址 multicast www docker 参数配置
原文地址:https://www.cnblogs.com/liuyi778/p/12771084.html