[lxc-users] Need help with static IP address -- Simplest use case.

Michael Johnson johnson at cognitech-ut.com
Sat Jun 10 02:03:58 UTC 2017


Hi Mark. Thanks for responding. I've done exactly what you suggest, and
here is the result from within the container:

ip -4 route show
default via 192.168.0.1 dev eth0  metric 12
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.36


ip -4 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default qlen 1
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
12: eth0 at if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
state UP group default qlen 1000 link-netnsid 0
    inet 192.168.0.36/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever


ping 192.168.0.21
PING 192.168.0.21 (192.168.0.21) 56(84) bytes of data.
>From 192.168.0.36 icmp_seq=1 Destination Host Unreachable
>From 192.168.0.36 icmp_seq=2 Destination Host Unreachable
>From 192.168.0.36 icmp_seq=3 Destination Host Unreachable

So the interface is failing to see the network.

-Mike

Mark Constable wrote:
> Once you have started a container then simply...
> 
> lxc exec CONTAINER_NAME bash
> 
> and bring up the eth0 interface however your OS normally does that job.



More information about the lxc-users mailing list