Assigning same IP to different MAC addresses?

Report wireless and/or network connectivity problems in this forum.

Moderator: Moderators

Post Reply
AlecR
Posts: 27
Joined: Tue Nov 05, 2013 3:28 pm

Assigning same IP to different MAC addresses?

Post 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?

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: Assigning same IP to different MAC addresses?

Post by n0pin »

It should be possible, althrough not from web interface.

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

AlecR
Posts: 27
Joined: Tue Nov 05, 2013 3:28 pm

Re: Assigning same IP to different MAC addresses?

Post 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?

User avatar
ericwong
Posts: 430
Joined: Sat Aug 25, 2012 6:15 am
Location: Melbourne, Australia
Contact:

Re: Assigning same IP to different MAC addresses?

Post 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.
Eric Wong

PM me if you need to buy Gargoyle router in Australia/NZ, willing to pay me to help you on your Gargoyle configurations or build custom configured ROM with pre-installed app or try to fix your bricked router. Yes, I am looking for job/work.

AlecR
Posts: 27
Joined: Tue Nov 05, 2013 3:28 pm

Re: Assigning same IP to different MAC addresses?

Post 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? :)

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: Assigning same IP to different MAC addresses?

Post 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.

AlecR
Posts: 27
Joined: Tue Nov 05, 2013 3:28 pm

Re: Assigning same IP to different MAC addresses?

Post 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?

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: Assigning same IP to different MAC addresses?

Post 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 .

Post Reply