代码: 全选
ifconfig
代码: 全选
ifconfig -a
使用
代码: 全选
ifocnfig eth0 up
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
下次启动又需要重新搞,怎么保存起来了?
baidu,google实在是没找到办法。
ps.
系统:archlinux-2011.08.19-core-i686.iso
虚拟机:colinux。
rc.conf中都有设置eth0,eth1
没图形,只有命令。
先谢了
代码: 全选
ifconfig
代码: 全选
ifconfig -a
代码: 全选
ifocnfig eth0 up
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
代码: 全选
shutdown -h now && 睡觉
如下:cuihao 写了:rc.conf
代码: 全选
interface=eth0
address=192.168.0.11
netmask=255.255.255.0
broadcast=192.168.0.255
gateway=192.168.0.1
interface=eth1
address=
netmask=
broadcast=
gateway=
代码: 全选
shutdown -h now && 睡觉
添加了~~cuihao 写了:network服务添加到DAEMON里没?
代码: 全选
shutdown -h now && 睡觉
没有,我是不想每次都手动ifconfig eth0 设置ip。枫叶饭团 写了:只是要保存命令?rc.local
代码: 全选
shutdown -h now && 睡觉
cuihao 写了:哦,俩链接……
rc.conf是shell脚本格式,那样做是不行的,后面的会把前面的覆盖,所以eth0不行。
要么用rc.conf,要么换networkmanager吧。
代码: 全选
INTERFACES=(eth0 eth1)
代码: 全选
shutdown -h now && 睡觉
实在不行,只能用这个绝招了。哈哈枫叶饭团 写了:你把这几个设置保存到rc.local,就能在开机的时候自动运行设置了嘛
代码: 全选
shutdown -h now && 睡觉
这个有呢。枫叶饭团 写了:rc.conf都没有怎么办呢...
代码: 全选
shutdown -h now && 睡觉
代码: 全选
# Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
#
# Wired network setup
# - interface: name of device (required)
# - address: IP address (leave blank for DHCP)
# - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
# - broadcast: broadcast address (ignored for DHCP) (optional)
# - gateway: default route (ignored for DHCP)
#
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
#
# DHCP example
# interface=eth0
# address=
# netmask=
# gateway=
interface=eth0
address=
netmask=
broadcast=
gateway=
interface=eth1
address=192.168.1.111
netmask=255.255.255.0
brodcast=192.168.1.255
gateway=192.168.1.1
代码: 全选
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
dhcpcd -k eth0
dhcpcd -nd eth0
代码: 全选
shutdown -h now && 睡觉