我在curlmyip.com上运行了curl,我得到了错误的输出ip地址.
我的systemd服务文件是: @H_403_3@[Unit] Description=Wired Networking Wants=network.target dibbler-client.service Before=network.target dibbler-client.service [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=/etc/conf.d/network ExecStart=/sbin/ip link set dev ${interface} up ExecStart=/sbin/ip addr add ${address}/24 dev ${interface} ExecStart=/sbin/ip addr add ${failover}/32 dev ${interface} ExecStart=/sbin/ip route add default via ${gateway} src ${failover} ExecStart=/sbin/ip -6 addr add ${addressv6}/64 dev ${interface} ExecStop=/sbin/ip addr flush dev ${interface} ExecStop=/sbin/ip -6 addr flush dev ${interface} ExecStop=/sbin/ip link set dev ${interface} down [Install] WantedBy=multi-user.target
我的systemd服务文件是: @H_403_3@[Unit] Description=Wired Networking Wants=network.target dibbler-client.service Before=network.target dibbler-client.service [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=/etc/conf.d/network ExecStart=/sbin/ip link set dev ${interface} up ExecStart=/sbin/ip addr add ${address}/24 dev ${interface} ExecStart=/sbin/ip addr add ${failover}/32 dev ${interface} ExecStart=/sbin/ip route add default via ${gateway} src ${failover} ExecStart=/sbin/ip -6 addr add ${addressv6}/64 dev ${interface} ExecStop=/sbin/ip addr flush dev ${interface} ExecStop=/sbin/ip -6 addr flush dev ${interface} ExecStop=/sbin/ip link set dev ${interface} down [Install] WantedBy=multi-user.target
变量是:
@H_403_3@interface=eno1 address=88.190.15.135 address6=2001:bc8:300a:dead::b12d failover=212.83.129.104 broadcast=88.190.15.255 gateway=88.190.15.1现在,ip addr给我:
@H_403_3@1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 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: eno1: <BROADCAST,MULTICAST,PROMISC,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether b8:ac:6f:94:e2:4e brd ff:ff:ff:ff:ff:ff inet 88.190.15.135/24 scope global eno1 valid_lft forever preferred_lft forever inet 212.83.129.104/32 scope global eno1 valid_lft forever preferred_lft forever inet6 fe80::baac:6fff:fe94:e24e/64 scope link valid_lft forever preferred_lft forever和ip路由:
@H_403_3@default via 88.190.15.1 dev eno1 src 212.83.129.104 88.190.15.0/24 dev eno1 proto kernel scope link src 88.190.15.135curlmyip.com告诉我输出的IP地址是88.190.15.135.如何更改此输出地址并使其成为212.83.129.104?
编辑:测试以更改到网关的路由的src …没有更改.
谢谢!