# Change gateway without reboot server

**URL:** <https://community.unix.com/t/change-gateway-without-reboot-server/256644>\
**Category:** Solaris\
**Created:** [December 29, 2009, 9:01pm UTC](https://community.unix.com/t/change-gateway-without-reboot-server/256644 "2009-12-29T21:01:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmartAntz](https://community.unix.com/letter_avatar/smartantz/32/6_22734026db12803ebb3e059622ac3534.png) [@SmartAntz](https://community.unix.com/u/SmartAntz)\
**Post date:** [December 29, 2009, 9:01pm UTC](https://community.unix.com/t/change-gateway-without-reboot-server/256644/1 "2009-12-29T21:01:06Z")

</div>

Hi Gurus

Recently i had change the gateway for a server  
i had change the IP in the /etc/defaultrouter  
and run the below command

```nohighlight
# route add default 10.86.33.222
# route delete default 10.86.33.1

# netstat -rn

Routing Table: IPv4
  Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
10.0.0.0 10.86.33.18 U 1 4359 hme0
224.0.0.0 10.86.33.18 U 1 0 hme0
default 10.86.33.222 UG 1 0
127.0.0.1 127.0.0.1 UH 61038511 lo0

```

when i traceroute my PC IP, it look like still use back the old route.

```nohighlight
# traceroute 10.13.5.156
traceroute to 10.13.5.156 (10.13.5.156), 30 hops max, 40 byte packets
 1 10.86.33.2 (10.86.33.2) 5.320 ms 0.349 ms 0.370 ms
 2 10.86.32.251 (10.86.32.251) 1.568 ms 1.127 ms 1.459 ms
 3 117.58.186.61 (117.58.186.61) 178.042 ms 5.784 ms 5.207 ms
 4 111.92.220.61 (111.92.220.61) 37.612 ms 35.106 ms 35.186 ms
 5 220.232.26.49 (220.232.26.49) 66.356 ms 65.040 ms 65.170 ms
 6 220.232.26.50 (220.232.26.50) 155.544 ms 86.923 ms 109.377 ms
 7 10.60.48.23 (10.60.48.23) 88.819 ms 95.388 ms 93.648 ms
 8 10.60.254.22 (10.60.254.22) 239.116 ms 277.526 ms 258.929 ms
 9 10.13.243.3 (10.13.243.3) 255.812 ms 241.631 ms 257.630 ms
10 * *

```

How to change the gateway without reboot the server?  
i cannot add a routing table, because i may use dial VPN to connect to this server.  
any idea ?

---

<div class="post-metadata">

**Author:** ![solaris\_user](https://community.unix.com/letter_avatar/solaris_user/32/6_22734026db12803ebb3e059622ac3534.png) [@solaris\_user](https://community.unix.com/u/solaris_user)\
**Post date:** [December 30, 2009, 8:08am UTC](https://community.unix.com/t/change-gateway-without-reboot-server/256644/2 "2009-12-30T08:08:54Z")

</div>

first you need to turn off ethernet

```nohighlight
ifconfig hme0 down

```

then delete old route

```nohighlight
route delete default 10.86.33.1

```

add new default route

```nohighlight
route add default 10.86.33.222

```

turn on ethernet

```nohighlight
ifconfig hme0 up

```

or insert line in

```nohighlight
 /etc/defaultrouter

```

and restart

```nohighlight
 svcadm restart physical

```

---

<div class="post-metadata">

**Author:** ![incredible](https://community.unix.com/letter_avatar/incredible/32/6_22734026db12803ebb3e059622ac3534.png) [@incredible](https://community.unix.com/u/incredible)\
**Post date:** [December 30, 2009, 10:48am UTC](https://community.unix.com/t/change-gateway-without-reboot-server/256644/3 "2009-12-30T10:48:31Z")

</div>

Your method and the order you followed is wrong. Perhaps use solaris\_user steps. It should work. But NOTE\*\*\* that your network connections will definitely get disconnected for sometime (not so bad as to rebooting the server)
