Page 1 of 1

Assigning same IP to different MAC addresses?

Posted: Mon Aug 18, 2014 6:20 am
by AlecR
On OpenWRT, you can assign the same IP to two different MAC addresses, i.e. when using a computer with both WiFi and ethernet.

Is this possible on Gargoyle?

Re: Assigning same IP to different MAC addresses?

Posted: Tue Aug 19, 2014 9:33 am
by n0pin
It should be possible, althrough not from web interface.

Look here:
http://wiki.openwrt.org/doc/uci/dhcp#st ... s.hot.swap

Re: Assigning same IP to different MAC addresses?

Posted: Thu Aug 21, 2014 10:09 am
by AlecR
Thanks for that.

I've looked at the site and I really have no idea how I would configure it. Can you help me out perhaps?

Re: Assigning same IP to different MAC addresses?

Posted: Fri Aug 22, 2014 11:45 am
by ericwong
AlecR wrote:Thanks for that.

I've looked at the site and I really have no idea how I would configure it. Can you help me out perhaps?
It should be the same procedure you would use on Openwrt.
if you manage to do it on Openwrt, you should be able to do that on Gargoyle in the same way.

Re: Assigning same IP to different MAC addresses?

Posted: Fri Aug 22, 2014 3:26 pm
by AlecR
I would have no idea how to do it on OpenWRT either (even after looking at the site you linked). Can you help me out? :)

Re: Assigning same IP to different MAC addresses?

Posted: Fri Aug 22, 2014 4:41 pm
by n0pin
AlecR wrote:I would have no idea how to do it on OpenWRT either (even after looking at the site you linked). Can you help me out? :)
You can use these commands:

Code: Select all

uci add dhcp host
uci set dhcp.@host[-1].name=example-host
uci set dhcp.@host[-1].mac="00:a0:24:5a:33:69 00:11:22:33:44:55"
uci set dhcp.@host[-1].ip=192.168.1.230
uci commit
/etc/init.d/dnsmasq restart
You can execute them using SSH or install webshell plugin in gargoyle.

Re: Assigning same IP to different MAC addresses?

Posted: Sat Aug 23, 2014 6:59 am
by AlecR
Thanks a lot :)

I don't suppose you know how to set custom DNS servers for only one client, without needing to set the DNS manually on said client? I.e. a DHCP-assigned custom DNS for only one client?

Re: Assigning same IP to different MAC addresses?

Posted: Tue Aug 26, 2014 2:23 pm
by n0pin
AlecR wrote:Thanks a lot :)

I don't suppose you know how to set custom DNS servers for only one client, without needing to set the DNS manually on said client? I.e. a DHCP-assigned custom DNS for only one client?
It is possible by using iptables. Assign it a static IP address.

Code: Select all

iptables -t nat -A PREROUTING -s 4.4.4.4 -p udp --dport 53 -j DNAT --to 8.8.8.8
iptables -t nat -A PREROUTING -s  4.4.4.4 -p tcp --dport 53 -j DNAT --to 8.8.8.8
These iptables should do it. Put this in /etc/firewall.user (replace 4.4.4.4 with static IP and 8.8.8.8 with DNS IP). After that run /etc/init.d/firewall restart.

Report back :D .