Is there a method to config static-mapping address quickly??


#1

I configed a dhcp server in the vyos,and now I want to add some static-mapping address,
i know the config command in the manual:

service dhcp‐server shared‐network‐name <name> subnet <ipv4net> static‐mapping <mapname> ip‐address <ipv4> service dhcp‐server shared‐network‐name <name> subnet <ipv4net> static‐mapping <mapname> mac‐address <mac>
but I have more than 50 computer,it’s hard to config them one by one,
is there a method to do this quickly??

ps: I tried to modify “/etc/dhcp3/dhcpd.conf” file,but it doesn’t work.


#2

If you have list of macs and needed ips, you just can generate set of commands from script


#3

Thanks for you,
and yes ,I can get the macs and the IP-address,
but how to run the script?? In the configure mode?

I write a simple script to test,and it is failed,
the script is:

configure show

the file name is t.sh
when i run:

It says:

[code]vyatta@vyatta:~$ sh t.sh

Invalid command: show [t.sh]
[/code]


#4

ok, I find it.
the correct command is “source”