Пример /etc/network/interfaces в Debian
1 2 3 4 5 |
iface eth0 inet static address <IP_ADDR> netmask 255.255.255.255 gateway <GW_IP_ADDR> pointopoint <GW_IP_ADDR> |
Можно через ifconfig
1 2 |
ifconfig eth0 inet <local_ip> netmask 255.255.255.255 pointopoint <destination_ip> ip route add default via <destination_ip> |
В CentOS чуть сложнее
- /etc/sysconfig/network-scripts/ifcfg-eth0
1234567DEVICE=eth0HWADDR=<MAC address>ONBOOT=yesBOOTPROTO=staticSCOPE="peer <GW_IP_ADDR>"IPADDR=<IP_ADDR>NETMASK=255.255.255.255
- /etc/sysconfig/network-scripts/route-eth0
123ADDRESS0=0.0.0.0NETMASK0=0.0.0.0GATEWAY0=<GW_IP_ADDR>