[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Best way to start eth0 without address



example for eth0 with 1.2.3.4 as default gateway

ip link set eth0 up

(requires the iproute package)

Now add an IP address to the loopback interface

ip addr add 192.168.1.10 dev lo

Now add a route to 192.168.1.0 out eth0

ip route add 192.168.1.0/24 dev eth0

Now we pretend our default gateway is 192.168.1.1

ip route add 0.0.0.0/0 via 192.168.1.1

done

I have eth0 set up as my gateway to the internet with no ip address
assigned to it. If I receive an arp request on ANY interface for
192.168.1.10, I will answer.






Reply to: