# Telegraf doesn't work as a service. Network unreachable

**URL:** <https://community.influxdata.com/t/telegraf-doesnt-work-as-a-service-network-unreachable/39671>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf\
**Created:** [December 4, 2024, 11:56am UTC](https://community.influxdata.com/t/telegraf-doesnt-work-as-a-service-network-unreachable/39671 "2024-12-04T11:56:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimas51](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dimas51/32/16952_2.png) [@dimas51](https://community.influxdata.com/u/dimas51)\
**Post date:** [December 4, 2024, 11:56am UTC](https://community.influxdata.com/t/telegraf-doesnt-work-as-a-service-network-unreachable/39671/1 "2024-12-04T11:56:34Z")

</div>

Hello!

OS:

```auto
  Operating System: Debian GNU/Linux 11 (bullseye)
            Kernel: Linux 6.1.0-21-2-amd64
      Architecture: x86-64

```

Telegraf:  
`Telegraf 1.33.0-26366121 (git: master@26366121)`

When running from cli: telegraf --config - its ok, metrics are pushed to influxdb.  
But when I set up telegraf as a systemd service - I got this:  
`E! [outputs.influxdb_v2] When writing to [http:/<influx-ip>:8086/api/v2/write]: Post "http://<influx-ip>:8086/api/v2/write?bucket=bucket1&org=org1": dial tcp <influx-ip>:8086: connect: network is unreachable`

Service config:

```auto
[Unit]

Description=system-telemetry.service

[Service]

ExecStart=/usr/local/bin/telegraf --config /usr/local/etc/system_telemetry/system_stat.cfg

ExecReload=/bin/kill -HUP $MAINPID

Restart=on-failure

[Install]

WantedBy=multi-user.target

```

---

<div class="post-metadata">

**Author:** ![dimas51](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dimas51/32/16952_2.png) [@dimas51](https://community.influxdata.com/u/dimas51)\
**Post date:** [December 4, 2024, 12:48pm UTC](https://community.influxdata.com/t/telegraf-doesnt-work-as-a-service-network-unreachable/39671/2 "2024-12-04T12:48:35Z")

</div>

Guys, i found the problem: Its in using management port inside management vrf…  
If eth0 in default - its working, in mgmt VRF - its not
