發新話題
打印

ubuntu點set返個ip??

ubuntu點set返個ip??

我之前係a電腦裝左個ubuntu
因有問題將係a電腦的hdd換到b電腦
但係hdd換到b電腦後
點樣先config返個ip??

而且塊底板個lan card是不同的
依家只係得返local host

因為係裝server所以得CLI冇GUI

或者有冇網站有教??
點先可以手動set個ip??
定係要裝過driver

TOP

用dmesg命令確認ubuntu能夠認出你的LAN 卡
dmesg | grep -i eth
若果輸出的結果有你張LAN卡就OK.
例如
dmesg | grep -i eth
[   31.842138] Driver 'sd' needs updating - please use bus_type methods
[   36.497210] 0000:00:19.0: eth0: (PCI Express:2.5GB/s:Width x1) 00:1a:6b:5f:96:a6
[   36.497213] 0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
[   36.497233] 0000:00:19.0: eth0: MAC: 5, PHY: 6, PBA No: ffffff-0ff
[   38.508522] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   38.560847] 0000:00:19.0: eth0: Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
[   38.560849] 0000:00:19.0: eth0: 10/100 speed: disabling TSO
[   38.561879] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   49.454109] eth0: no IPv6 routers present


接著 edit /etc/network/interfaces
auto eth0
iface eth0 inet static
        address [your ip address]
        netmask [your network mask]
        network [your network id (option)]
        broadcast [your broadcast address (option)]
        gateway [your gateway ip]

TOP

打完這個dmesg | grep -i eth之後
得一行野
eth0 sis 900 xxxxxxxxxxx at 0x8800, IRQ19, mac address
已經依照步驟做完
ifconfig依然得個local loopback


個hdd係係第二塊底板度換來的要不要裝driver?

TOP

有沒有 restart network

或者可以試下以下命令

ifconfig eth0 <your ip address> netmask <network mask>

另外, 檢查下modules是否己經load 左sis900..如果無就代表你的ubuntu沒有安裝sis900的driver...去google查下點裝
lsmod | grep sis

TOP

發新話題