[BMC]How to save static IP address in BMC

Steven_zhangCreated at:Apr 30, 2021 13:44:45

1. Login OpenBmc by username “root”, password “0penBmc”(number 0)

2.  Use command “vi /mnt/data/etc/rc.local” modify rc.local,push "i" and the then add blow command. After modify, push ESC and then type :wq for saving and exit

#!/bin/sh

# Release DHCP

dhclient -r -v eth0

# Configure IPv4 address and Gateway

ip addr add 192.168.200.190/24 dev eth0

ip route add default via 192.168.200.254

 

3.  use command “cat /mnt/data/etc/ rc.local” check rc.local

blob.png

 

4. use command “chmod +x /mnt/data/etc/rc.local” set rc.local

blob.png


5. reboot the BMC,the static ip and gateway will be actived.