Linux – multiples ip on interface. i wish to specify one of these for output – server fault
I ran curl on curlmyip.com, and that i got the incorrect output ip.
My systemd service file is:
[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 $ up
ExecStart=/sbin/ip addr add $/24 dev $
ExecStart=/sbin/ip addr add $/32 dev $
ExecStart=/sbin/ip route add default via $ src $
ExecStart=/sbin/ip -6 addr add $/64 dev $
ExecStop=/sbin/ip addr flush dev $
ExecStop=/sbin/ip -6 addr flush dev $
ExecStop=/sbin/ip link set dev $ lower
[Install]
WantedBy=multi-user.target
And variables are:
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
Now, ip addr produce:
1: lo: mtu 65536 qdisc noqueue condition UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127…1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: mtu 1500 qdisc mq condition 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
and ip route:
default via 88.190.15.1 dev eno1 src 212.83.129.104
88.190.15./24 dev eno1 proto kernel scope link src 88.190.15.135
I ran curl on curlmyip.com, and that i got the incorrect output ip.
My systemd service file is:
[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 $ up
ExecStart=/sbin/ip addr add $/24 dev $
ExecStart=/sbin/ip addr add $/32 dev $
ExecStart=/sbin/ip route add default via $ src $
ExecStart=/sbin/ip -6 addr add $/64 dev $
ExecStop=/sbin/ip addr flush dev $
ExecStop=/sbin/ip -6 addr flush dev $
ExecStop=/sbin/ip link set dev $ lower
[Install]
WantedBy=multi-user.target
And variables are:
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
Now, ip addr produce:
1: lo: mtu 65536 qdisc noqueue condition UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127…1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: mtu 1500 qdisc mq condition 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
and ip route:
default via 88.190.15.1 dev eno1 src 212.83.129.104
88.190.15./24 dev eno1 proto kernel scope link src 88.190.15.135
curlmyip.com let me know the output ip is 88.190.15.135. How do i change this output address making it 212.83.129.104?
EDIT: tested to alter the src from the path to the gateway… No changes.
Thanks!
Resourse: https://serverfault.com/questions/542424/